From: Jens Axboe Date: Thu, 2 Feb 2006 10:16:05 +0000 (+0100) Subject: [PATCH] blktrace: remove check_time, we always need to check it X-Git-Tag: blktrace-0.99.1~84 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=89482da65bbe96da701e2c873e3eeb3016b4e651;p=blktrace.git [PATCH] blktrace: remove check_time, we always need to check it --- 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; }