Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=70cee26e020c1d74ff559c991b96c7b19fa4173b Commit: 70cee26e020c1d74ff559c991b96c7b19fa4173b Parent: fd11d171e51a5b81c176d856d5df5612117e1a45 Author: Matthias Kaehlcke <[EMAIL PROTECTED]> AuthorDate: Tue Jul 10 12:26:24 2007 +0200 Committer: Jens Axboe <[EMAIL PROTECTED]> CommitDate: Tue Jul 10 13:43:32 2007 +0200
Use list_for_each_entry() instead of list_for_each() in the block device elevator Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Jens Axboe <[EMAIL PROTECTED]> --- block/elevator.c | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index ce866eb..4769a25 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -112,12 +112,8 @@ 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; - struct list_head *entry; - - list_for_each(entry, &elv_list) { - - e = list_entry(entry, struct elevator_type, list); + list_for_each_entry(e, &elv_list, list) { if (!strcmp(e->elevator_name, name)) return e; } @@ -1116,14 +1112,11 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name) { elevator_t *e = q->elevator; struct elevator_type *elv = e->elevator_type; - struct list_head *entry; + struct elevator_type *__e; int len = 0; spin_lock(&elv_list_lock); - list_for_each(entry, &elv_list) { - struct elevator_type *__e; - - __e = list_entry(entry, struct elevator_type, list); + list_for_each_entry(__e, &elv_list, list) { if (!strcmp(elv->elevator_name, __e->elevator_name)) len += sprintf(name+len, "[%s] ", elv->elevator_name); else - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html