summaryrefslogtreecommitdiff
path: root/block/elevator.c
diff options
context:
space:
mode:
authorVasily Tarasov <vtaras@openvz.org>2006-10-11 09:24:27 +0200
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-10-12 15:08:51 +0200
commita22b169df1b9f259391cf3b8ad8bfeea3d7be3f1 (patch)
treec03c0fb3de87afc0c67a4a973a826deed4bb9d20 /block/elevator.c
parent2b1191af683d16a899c2b81b87b605841ceffdec (diff)
downloadlwn-a22b169df1b9f259391cf3b8ad8bfeea3d7be3f1.tar.gz
lwn-a22b169df1b9f259391cf3b8ad8bfeea3d7be3f1.zip
[PATCH] block layer: elevator_find function cleanup
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>
Diffstat (limited to 'block/elevator.c')
-rw-r--r--block/elevator.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 487dd3da8853..d8030a84773a 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -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)