Commit 6219c2a2 authored by Geliang Tang's avatar Geliang Tang Committed by Linus Torvalds

mm/vmalloc.c: use list_{next,first}_entry

To make the intention clearer, use list_{next,first}_entry instead of
list_entry.
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 33d53103
...@@ -441,8 +441,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, ...@@ -441,8 +441,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
if (list_is_last(&first->list, &vmap_area_list)) if (list_is_last(&first->list, &vmap_area_list))
goto found; goto found;
first = list_entry(first->list.next, first = list_next_entry(first, list);
struct vmap_area, list);
} }
found: found:
...@@ -2559,10 +2558,10 @@ static void *s_start(struct seq_file *m, loff_t *pos) ...@@ -2559,10 +2558,10 @@ static void *s_start(struct seq_file *m, loff_t *pos)
struct vmap_area *va; struct vmap_area *va;
spin_lock(&vmap_area_lock); spin_lock(&vmap_area_lock);
va = list_entry((&vmap_area_list)->next, typeof(*va), list); va = list_first_entry(&vmap_area_list, typeof(*va), list);
while (n > 0 && &va->list != &vmap_area_list) { while (n > 0 && &va->list != &vmap_area_list) {
n--; n--;
va = list_entry(va->list.next, typeof(*va), list); va = list_next_entry(va, list);
} }
if (!n && &va->list != &vmap_area_list) if (!n && &va->list != &vmap_area_list)
return va; return va;
...@@ -2576,7 +2575,7 @@ static void *s_next(struct seq_file *m, void *p, loff_t *pos) ...@@ -2576,7 +2575,7 @@ static void *s_next(struct seq_file *m, void *p, loff_t *pos)
struct vmap_area *va = p, *next; struct vmap_area *va = p, *next;
++*pos; ++*pos;
next = list_entry(va->list.next, typeof(*va), list); next = list_next_entry(va, list);
if (&next->list != &vmap_area_list) if (&next->list != &vmap_area_list)
return next; return next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment