From: Pierre Gondois Date: Thu, 4 Jan 2024 16:49:34 +0000 (+0100) Subject: binder: use of hlist_count_nodes() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3fa2601e4a1fe3ec8068f7bee41a13afa061f6ae;p=linux.git binder: use of hlist_count_nodes() Make use of the newly added hlist_count_nodes(). Link: https://lkml.kernel.org/r/20240104164937.424320-3-pierre.gondois@arm.com Signed-off-by: Pierre Gondois Acked-by: Carlos Llamas Acked-by: Marco Elver Reviewed-by: Andy Shevchenko Cc: Arve Hjønnevåg Cc: Christian Brauner Cc: Coly Li Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: Jani Nikula Cc: Joel Fernandes (Google) Cc: Kees Cook Cc: Kent Overstreet Cc: Martijn Coenen Cc: Suren Baghdasaryan Cc: Todd Kjos Signed-off-by: Andrew Morton --- diff --git a/drivers/android/binder.c b/drivers/android/binder.c index eca24f41556df..bad28cf420104 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -6086,9 +6086,7 @@ static void print_binder_node_nilocked(struct seq_file *m, struct binder_work *w; int count; - count = 0; - hlist_for_each_entry(ref, &node->refs, node_entry) - count++; + count = hlist_count_nodes(&node->refs); seq_printf(m, " node %d: u%016llx c%016llx hs %d hw %d ls %d lw %d is %d iw %d tr %d", node->debug_id, (u64)node->ptr, (u64)node->cookie,