Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7851580rdb; Thu, 4 Jan 2024 09:32:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IF67gkNuir462qC783LeZd+/+9wCQtc+6N/XyWheezHrvflIJIwr4z8jlWc5VYXIIg0hkhY X-Received: by 2002:a05:6830:1d4c:b0:6d8:187b:f2e with SMTP id p12-20020a0568301d4c00b006d8187b0f2emr960569oth.24.1704389520511; Thu, 04 Jan 2024 09:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704389520; cv=none; d=google.com; s=arc-20160816; b=CvTFHX2icTMCIQ7yN0lNDf86pU+oQDurPuLmgAASrZtwVgarveAuHFw4AjYuRz0DIh hdp4xuad6a1164JGzqeIwJrgRM4an6PM9Jo8TZjwpj6H9hn6GQ74wJrBXD/GaHkKpa9a pIEEqIixwV0H7HOFgH7jb6yN8rYzJU8k9hSeq8lNmL3RTqpod4VVLbvE3QIgOBmucjiW iWNbtDY7Wibkj/ZGeXn/v+27PZPP4kVVbljysLkw0QBBV2g2MdaPXp3AJGvRhW2+YHzt jB1rKyDo3OGeF+7Z+GdnUJxnm3SqUsCvaI5CA5Yq6vRjj+N8yyeMWuZiHTW1N7N8Gjpi KpDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=j2qn6VAQhWQUb4CiHmq8h+Yo362Cgbx3EEBUJCdDtwc=; fh=OXwDei6zozlOEdMtt6D6A4ZCVVMSoTDzufcN0DzLDuY=; b=zWxUmTDY7vVZLrnpxXOEzKRZaBFMhrxCyi0AiDTHgK1Ed4xtPrCkWxme7mJcab1Wm6 QBS+eBEMgI9hc2rbufKZ9HPRoqwQfETOZJZP5h9ywSSn0yk/GiHqsQEx3pUKjRXYMkDI kapnzZBUgh8fATnXvGhJnnjX9YuzteN4P+qvDzXK/xcQPu10l1tcc4YyD9aAQMrx8GGd Mwwk7g/oH8GY9bhVnRFIwR8/Z3uMhj1DcWycr6N624uCaCaKiH5K4QEKfVUa4QUQFAtM sB7hmur36T37VbtNHhj/5MP67erPbSPgm05i3rBAXCPHQavXlQITs6grgDRBnuwuzUN5 cIUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WQr6YuxP; spf=pass (google.com: domain of linux-kernel+bounces-17042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17042-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d2-20020a67c482000000b0046726fd117bsi2203741vsk.474.2024.01.04.09.32.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:32:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WQr6YuxP; spf=pass (google.com: domain of linux-kernel+bounces-17042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17042-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3BDB61C241BF for ; Thu, 4 Jan 2024 17:32:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85681286B2; Thu, 4 Jan 2024 17:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="WQr6YuxP" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8673928DB8 for ; Thu, 4 Jan 2024 17:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1d44200b976so4960175ad.2 for ; Thu, 04 Jan 2024 09:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704389509; x=1704994309; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=j2qn6VAQhWQUb4CiHmq8h+Yo362Cgbx3EEBUJCdDtwc=; b=WQr6YuxPgGGirkeMuBYn5m87aN/cWl4KLkdmtHWAe2SMlLpElb62RkJyO5b6q3qD/o 4sXA4EgRRRzrB7/2cb3geQBDsRz/nD7ReYUpyYB6QKuQoP6tV9r0A8BQO4vL3Q6NCRLC qsW/ooJr0c10Pp8kq0dWD6aZ1QHk3spJ5lCkvgSpYltKWfwbzQ27Xj1LGlTUIk/n6xPD nkuMM7bsulVLJCSCD3N7KLTkooYvh8EwYwbnRFtUlueEnuJjsrpkJOPtMGNyUY88s7VG YavHcxPLjpDsJpY/jwk78eq3MFEvR/TVt66k81sCJRsowLt8u/QGbbgfpMYKZz+KpT/p E7Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704389509; x=1704994309; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=j2qn6VAQhWQUb4CiHmq8h+Yo362Cgbx3EEBUJCdDtwc=; b=oiDkRBOYC6LBa0Y7LxnIHs0NkFDGFBU7BWucwRKzrCgASPG200Hf07s5F+xzzNzYiC KCkrs7iRBaDkZWFwvS+HUxbuScvrqDanYBeHlOcyJaj4JzcSeDAsI6eoXGkTPKXdPU4e 35x2L5Aegzk6DIqacrckvSPPVZ+raK+ypT+x6Qa/4ajT8ROwWjwWipuJOTyACdgtlAmt 1+ofGRF0wgzLn5R9ZHZH0O/1Kq7ZbiHwlrKEJQ8SJGNuWHc2MuoNqPN58hrm1a7DDpH9 zj9/VzYdgeSfOgDkoP1T7furG71Zen9SMI1Ufwd/vxXt5uyk2BwojJ4zvXJJLi/3iezn Oh2w== X-Gm-Message-State: AOJu0Yw9W53acgx2unjKsfKSaYDx1P7Tk0IYtwCjz4vjv+EF0HWleNnK 9J1OmaSUhSUnG4RveZqm7OZZ2Y/i3Yrj X-Received: by 2002:a17:902:f68e:b0:1d4:4483:67d4 with SMTP id l14-20020a170902f68e00b001d4448367d4mr692781plg.89.1704389508707; Thu, 04 Jan 2024 09:31:48 -0800 (PST) Received: from google.com (77.62.105.34.bc.googleusercontent.com. [34.105.62.77]) by smtp.gmail.com with ESMTPSA id y22-20020a170902b49600b001d4910ff83dsm13256439plr.121.2024.01.04.09.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:31:48 -0800 (PST) Date: Thu, 4 Jan 2024 17:31:45 +0000 From: Carlos Llamas To: Pierre Gondois Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Suren Baghdasaryan , Coly Li , Kent Overstreet , Marco Elver , Kees Cook , Lucas De Marchi , Ingo Molnar , Andy Shevchenko , linux-bcache@vger.kernel.org Subject: Re: [PATCH v2 2/3] binder: Use of hlist_count_nodes() Message-ID: References: <20240104164937.424320-1-pierre.gondois@arm.com> <20240104164937.424320-3-pierre.gondois@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240104164937.424320-3-pierre.gondois@arm.com> On Thu, Jan 04, 2024 at 05:49:34PM +0100, Pierre Gondois wrote: > Make use of the newly added hlist_count_nodes(). > > Signed-off-by: Pierre Gondois > --- > drivers/android/binder.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/android/binder.c b/drivers/android/binder.c > index 92128aae2d06..f9ca4d58d825 100644 > --- a/drivers/android/binder.c > +++ b/drivers/android/binder.c > @@ -6077,9 +6077,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, > -- > 2.25.1 > Looks good to me! Acked-by: Carlos Llamas