* [PATCH] mm/vmalloc: use list_{next,first}_entry
@ 2015-11-16 14:10 ` Geliang Tang
0 siblings, 0 replies; 2+ messages in thread
From: Geliang Tang @ 2015-11-16 14:10 UTC (permalink / raw)
To: Andrew Morton, Joonsoo Kim, Roman Pen, Andrey Ryabinin
Cc: Geliang Tang, linux-mm, linux-kernel
To make the intention clearer, use list_{next,first}_entry instead
of list_entry.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
mm/vmalloc.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index d045634..c89ce9d 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -441,8 +441,7 @@ nocache:
if (list_is_last(&first->list, &vmap_area_list))
goto found;
- first = list_entry(first->list.next,
- struct vmap_area, list);
+ first = list_next_entry(first, list);
}
found:
@@ -2560,10 +2559,10 @@ static void *s_start(struct seq_file *m, loff_t *pos)
struct vmap_area *va;
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) {
n--;
- va = list_entry(va->list.next, typeof(*va), list);
+ va = list_next_entry(va, list);
}
if (!n && &va->list != &vmap_area_list)
return va;
@@ -2577,7 +2576,7 @@ static void *s_next(struct seq_file *m, void *p, loff_t *pos)
struct vmap_area *va = p, *next;
++*pos;
- next = list_entry(va->list.next, typeof(*va), list);
+ next = list_next_entry(va, list);
if (&next->list != &vmap_area_list)
return next;
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] mm/vmalloc: use list_{next,first}_entry
@ 2015-11-16 14:10 ` Geliang Tang
0 siblings, 0 replies; 2+ messages in thread
From: Geliang Tang @ 2015-11-16 14:10 UTC (permalink / raw)
To: Andrew Morton, Joonsoo Kim, Roman Pen, Andrey Ryabinin
Cc: Geliang Tang, linux-mm, linux-kernel
To make the intention clearer, use list_{next,first}_entry instead
of list_entry.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
mm/vmalloc.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index d045634..c89ce9d 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -441,8 +441,7 @@ nocache:
if (list_is_last(&first->list, &vmap_area_list))
goto found;
- first = list_entry(first->list.next,
- struct vmap_area, list);
+ first = list_next_entry(first, list);
}
found:
@@ -2560,10 +2559,10 @@ static void *s_start(struct seq_file *m, loff_t *pos)
struct vmap_area *va;
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) {
n--;
- va = list_entry(va->list.next, typeof(*va), list);
+ va = list_next_entry(va, list);
}
if (!n && &va->list != &vmap_area_list)
return va;
@@ -2577,7 +2576,7 @@ static void *s_next(struct seq_file *m, void *p, loff_t *pos)
struct vmap_area *va = p, *next;
++*pos;
- next = list_entry(va->list.next, typeof(*va), list);
+ next = list_next_entry(va, list);
if (&next->list != &vmap_area_list)
return next;
--
2.5.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-16 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 14:10 [PATCH] mm/vmalloc: use list_{next,first}_entry Geliang Tang
2015-11-16 14:10 ` Geliang Tang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.