kmemleak: Replace list_for_each_continue_rcu with new interface
authorMichael Wang <wangyun@linux.vnet.ibm.com>
Fri, 17 Aug 2012 04:33:34 +0000 (12:33 +0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 23 Sep 2012 14:42:52 +0000 (07:42 -0700)
This patch replaces list_for_each_continue_rcu() with
list_for_each_entry_continue_rcu() to save a few lines
of code and allow removing list_for_each_continue_rcu().

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
mm/kmemleak.c

index 45eb6217bf38e764bfb65d90f29ae2bb46f77886..0de83b4541e9d692d92a28da0f302714ee4ea1db 100644 (file)
@@ -1483,13 +1483,11 @@ static void *kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
        struct kmemleak_object *prev_obj = v;
        struct kmemleak_object *next_obj = NULL;
-       struct list_head *n = &prev_obj->object_list;
+       struct kmemleak_object *obj = prev_obj;
 
        ++(*pos);
 
-       list_for_each_continue_rcu(n, &object_list) {
-               struct kmemleak_object *obj =
-                       list_entry(n, struct kmemleak_object, object_list);
+       list_for_each_entry_continue_rcu(obj, &object_list, object_list) {
                if (get_object(obj)) {
                        next_obj = obj;
                        break;