aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2007-07-10 06:26:24 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-07-10 07:43:32 -0400
commit70cee26e020c1d74ff559c991b96c7b19fa4173b (patch)
treea2d73f170c8d7db29eaca27dbc06b6c6218a8f55 /block
parentfd11d171e51a5b81c176d856d5df5612117e1a45 (diff)
Use list_for_each_entry() instead of list_for_each() in the block device
elevator Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/elevator.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/block/elevator.c b/block/elevator.c
index ce866eb75f6a..4769a25d7037 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)
112static struct elevator_type *elevator_find(const char *name) 112static struct elevator_type *elevator_find(const char *name)
113{ 113{
114 struct elevator_type *e; 114 struct elevator_type *e;
115 struct list_head *entry;
116
117 list_for_each(entry, &elv_list) {
118
119 e = list_entry(entry, struct elevator_type, list);
120 115
116 list_for_each_entry(e, &elv_list, list) {
121 if (!strcmp(e->elevator_name, name)) 117 if (!strcmp(e->elevator_name, name))
122 return e; 118 return e;
123 } 119 }
@@ -1116,14 +1112,11 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
1116{ 1112{
1117 elevator_t *e = q->elevator; 1113 elevator_t *e = q->elevator;
1118 struct elevator_type *elv = e->elevator_type; 1114 struct elevator_type *elv = e->elevator_type;
1119 struct list_head *entry; 1115 struct elevator_type *__e;
1120 int len = 0; 1116 int len = 0;
1121 1117
1122 spin_lock(&elv_list_lock); 1118 spin_lock(&elv_list_lock);
1123 list_for_each(entry, &elv_list) { 1119 list_for_each_entry(__e, &elv_list, list) {
1124 struct elevator_type *__e;
1125
1126 __e = list_entry(entry, struct elevator_type, list);
1127 if (!strcmp(elv->elevator_name, __e->elevator_name)) 1120 if (!strcmp(elv->elevator_name, __e->elevator_name))
1128 len += sprintf(name+len, "[%s] ", elv->elevator_name); 1121 len += sprintf(name+len, "[%s] ", elv->elevator_name);
1129 else 1122 else