Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp724956rdb; Sat, 6 Jan 2024 06:36:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6IeArd/Eg+MwZ3yZKNI5Bo8tPjJFA1/oNDq0whjI5X+wMExK9CmCD4JnHacXPT1pcn/W5 X-Received: by 2002:a17:906:c441:b0:a28:cde1:43a9 with SMTP id ck1-20020a170906c44100b00a28cde143a9mr396413ejb.9.1704551811325; Sat, 06 Jan 2024 06:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704551811; cv=none; d=google.com; s=arc-20160816; b=ZKS94Kjc2bMOO9tmnpUF1mag5SS47UQyaTaI2tyo0iJcgox3/VlqZFKiGCp+g1jO6l D1IE9zMJJh4OOwT0q1yW/tj15Wlm5hbncIOZ07OMt87g/RsupmGl199GX7LFE3EhDlfX xYeT7lvTNrrMwjoCtWlBwu5bZ7qJAzIBhdSfwOb6IwIXPasT3tr1Mr9JcU3+mJzwwv6N vcVSqxsH/ad5iGHDftpaK1t5obpBX+E4HDq8/QMZaXaNYCEU2AwuD5MEnHRDgwhimTh0 pS2H6ngkaOMM3kqWvJhaeyVTYhiqtzQfKz/ZO2NE+XOB7T/5RGN7g0R46gwZNz8BoM3n nHPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization: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=ThiOB1q8S9BEQNXJPwgyM/XhX3d5sc1kdMhEwQJI4gU=; fh=+rVFY8lDE6G724GWt8kT1j1LQBNkhSM98g0IdcRcL2U=; b=e/pNvB+dyCsuhYQXIHUlMlht7W8GnJYz9bGOwK+SW53hZNhD1QVKg80fdr0sJus8Tw i3OHecv7Kpju447NPWG8kqsL4kgQnk0nNG5fGgnqzv8cnrBfhoB+XgprBgey44A5o932 OYNssMvUSw/CivpdxmNa8nvvoCcqcbIuGZ3nb7IRnin3HEkGlMXUZrU2eP6U26p6TeiT gfdTfPm473Ja0UoJegiIWqXy+lL9Z9mHs70sx/773LlrYkIX7JQJOiXXKwbeT6Qc0AJc TdwpK4dq94J820yiPl6zc8bKBaPexAsVi4qRk084OwXGjRAPmT729sYowXmV7NPOR0OH ql/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZAA2nBTM; spf=pass (google.com: domain of linux-kernel+bounces-18602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id au11-20020a170907092b00b00a2a1f18f88fsi155052ejc.653.2024.01.06.06.36.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 06:36:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZAA2nBTM; spf=pass (google.com: domain of linux-kernel+bounces-18602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 14A681F22628 for ; Sat, 6 Jan 2024 14:36:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9C9C847A; Sat, 6 Jan 2024 14:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZAA2nBTM" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF1D3882E; Sat, 6 Jan 2024 14:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704551795; x=1736087795; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=LcQHKTNnzexQYEQpKyQzDBzYwTLlJSqPJzl708DLwh8=; b=ZAA2nBTMq0Fv2VA7VrgxLJBPb1QFbnmVhx2Jm+fub83GN8AvLzKU3nEl Un8XmMsbecDRzBI/S+EtoI2eUb8mnZ5kaUcyduI/LdlAVCK/gXLXDiw1S PylwTJMs7LgjPT8LW+aVTqlgIbFk7KbJ/bb6EsGAyHOnI/IIHBKn0ysdo K+Ado9TWV+v7+9kqqP4Dp35ZRHnJl2TPyukfBRVg78eNOonzzHBotK8c1 bxy2fZzkIcLOc5m+lTUBef8s8Oo0u9YdQYXBAnT6ILu7KtJnlVHaIbMm0 aXVbm5zx2QdJIMLsdA9wDYOLdy1om47PAFz6qvxNNVO+3R02MLgCY+zDq Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10945"; a="382629178" X-IronPort-AV: E=Sophos;i="6.04,337,1695711600"; d="scan'208";a="382629178" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2024 06:36:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10945"; a="846814579" X-IronPort-AV: E=Sophos;i="6.04,337,1695711600"; d="scan'208";a="846814579" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2024 06:36:31 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rM7ml-0000000Bvjm-3ts2; Sat, 06 Jan 2024 16:36:27 +0200 Date: Sat, 6 Jan 2024 16:36:27 +0200 From: Andy Shevchenko 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 , Carlos Llamas , Suren Baghdasaryan , Coly Li , Kent Overstreet , Marco Elver , Kees Cook , Lucas De Marchi , Ingo Molnar , linux-bcache@vger.kernel.org Subject: Re: [PATCH v2 3/3] bcache: Use of hlist_count_nodes() Message-ID: References: <20240104164937.424320-1-pierre.gondois@arm.com> <20240104164937.424320-4-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-4-pierre.gondois@arm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Jan 04, 2024 at 05:49:35PM +0100, Pierre Gondois wrote: > Make use of the newly added hlist_count_nodes(). ... > for (h = c->bucket_hash; > h < c->bucket_hash + (1 << BUCKET_HASH_BITS); > h++) { > - unsigned int i = 0; > - struct hlist_node *p; > - > - hlist_for_each(p, h) > - i++; > - > - ret = max(ret, i); > + ret = max(ret, hlist_count_nodes(h)); > } After this you probably may drop {}. -- With Best Regards, Andy Shevchenko