]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] block layer: elevator_find function cleanup
authorVasily Tarasov <vtaras@openvz.org>
Wed, 11 Oct 2006 07:24:27 +0000 (09:24 +0200)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Thu, 12 Oct 2006 13:08:51 +0000 (15:08 +0200)
We can easily produce search through the elevator list
without introducing additional elevator_type variable.

Signed-off-by: Vasily Tarasov <vtaras@openvz.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/elevator.c

index 487dd3da8853971d9bcb77cf6ecf51eb39faedf3..d8030a84773a69b847ba6b84eefb6f887811f0bd 100644 (file)
@@ -93,21 +93,18 @@ static inline int elv_try_merge(struct request *__rq, struct bio *bio)
 
 static struct elevator_type *elevator_find(const char *name)
 {
-       struct elevator_type *e = NULL;
+       struct elevator_type *e;
        struct list_head *entry;
 
        list_for_each(entry, &elv_list) {
-               struct elevator_type *__e;
 
-               __e = list_entry(entry, struct elevator_type, list);
+               e = list_entry(entry, struct elevator_type, list);
 
-               if (!strcmp(__e->elevator_name, name)) {
-                       e = __e;
-                       break;
-               }
+               if (!strcmp(e->elevator_name, name))
+                       return e;
        }
 
-       return e;
+       return NULL;
 }
 
 static void elevator_put(struct elevator_type *e)