Skip to content

Commit

Permalink
kmemleak: Replace list_for_each_continue_rcu with new interface
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
  • Loading branch information
Michael Wang authored and paulmck committed Sep 23, 2012
1 parent 803b0eb commit 58fac09
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 58fac09

Please sign in to comment.