summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blkparse.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/blkparse.c b/blkparse.c
index 4a14f32..578353c 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -465,8 +465,7 @@ static struct per_process_info *find_process(__u32 pid, char *name)
return ppi;
}
-static inline int trace_rb_insert(struct trace *t, struct rb_root *root,
- int check_time)
+static inline int trace_rb_insert(struct trace *t, struct rb_root *root)
{
struct rb_node **p = &root->rb_node;
struct rb_node *parent = NULL;
@@ -477,16 +476,11 @@ static inline int trace_rb_insert(struct trace *t, struct rb_root *root,
__t = rb_entry(parent, struct trace, rb_node);
- if (check_time) {
- if (t->bit->time < __t->bit->time) {
- p = &(*p)->rb_left;
- continue;
- } else if (t->bit->time > __t->bit->time) {
- p = &(*p)->rb_right;
- continue;
- }
- }
- if (t->bit->device < __t->bit->device)
+ if (t->bit->time < __t->bit->time)
+ p = &(*p)->rb_left;
+ else if (t->bit->time > __t->bit->time)
+ p = &(*p)->rb_right;
+ else if (t->bit->device < __t->bit->device)
p = &(*p)->rb_left;
else if (t->bit->device > __t->bit->device)
p = &(*p)->rb_right;
@@ -503,7 +497,7 @@ static inline int trace_rb_insert(struct trace *t, struct rb_root *root,
static inline int trace_rb_insert_sort(struct trace *t)
{
- if (!trace_rb_insert(t, &rb_sort_root, 1)) {
+ if (!trace_rb_insert(t, &rb_sort_root)) {
rb_sort_entries++;
return 0;
}
@@ -513,7 +507,7 @@ static inline int trace_rb_insert_sort(struct trace *t)
static inline int trace_rb_insert_last(struct per_dev_info *pdi,struct trace *t)
{
- if (!trace_rb_insert(t, &pdi->rb_last, 1)) {
+ if (!trace_rb_insert(t, &pdi->rb_last)) {
pdi->rb_last_entries++;
return 0;
}