Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7131036rdb; Wed, 3 Jan 2024 05:46:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFM24Ua5wtMCTUZcQ3fR8e4qpaFwPNQY6WJc3/WM3n6QNPPyTNBAvMN/UNHscQzLy6l5MQ X-Received: by 2002:ac8:59d2:0:b0:428:34f0:7313 with SMTP id f18-20020ac859d2000000b0042834f07313mr1815064qtf.100.1704289608654; Wed, 03 Jan 2024 05:46:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704289608; cv=none; d=google.com; s=arc-20160816; b=bmtkg6Cs4rWZ2n/YTTNzPuJOaG30ubeDChBcLfk9Btz1fVoqYF0A1AMfe+wudzMWyJ LnC5AsbRiSfnvEO5/8WCSpfL0eieR1NqPiem4nsLt+Sd1VS0QmIh57ZG5w59UjLdSCPF P8JLkkjLmreoVR6xXAMpeC3rGSOqU3vnKDLdZPUqmAbW/1GbTVShHRc5CSeH0rBIoXgM 2BmbT4xnnbSLEYVDBXl5Tc8leInid/8sXQdWO5N/6ZDKbypztx/ycCIPPVXNelMtswnS vgIEnEcnetdT+V19HEUWXs+jCMB6sHcmAm0OK+lKr2na8tA9IPRt2SzDJUvWZER7mban 0uKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=iXiRlPNEbOMVVR0getTtwBYLPyTAkQ6ZYT+RkbvnME4=; fh=84m252wMnQ03WdEebdzUADuZ1P5ba3pEZ8Y0O+Ar/Ac=; b=fuFGGm9qRbLF80e9VTiUjE6GAzYlb66go5ehv/vmHzdZOxH0brBVSG8noRqhF1vVO7 8ohLURlL5+Bsb600g5kBXV7IsCKfSEjcmgpGqm1b5Su2MG1egX8gynDnzpkJt5zASw5X 4qa2PwPW+toV9yUfBQlnWYTEArwHbwoX80iJIjK3XvJp0gEJccLsjEBjhv7qSFLNcc2B TT77aCdeutxyCdZenDLjSkHcsNP5IS1rmgd36PdZAyl6bHby1I9skFstDFJwwfkBC0Vs eSe5uQoTTeUzIP/c3mSF/iT9K1EmB1fsCwVZ/idQGh4yTvwT/XcySBmdIp+Pac7WslgW 1x8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YjxHSvjG; spf=pass (google.com: domain of linux-kernel+bounces-15616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15616-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. [147.75.199.223]) by mx.google.com with ESMTPS id ay36-20020a05622a22a400b004283d0de9adsi160407qtb.728.2024.01.03.05.46.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:46:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YjxHSvjG; spf=pass (google.com: domain of linux-kernel+bounces-15616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15616-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 6A3FC1C2179E for ; Wed, 3 Jan 2024 13:46:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95C971A58E; Wed, 3 Jan 2024 13:46:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YjxHSvjG" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com [209.85.221.176]) (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 89F841A582 for ; Wed, 3 Jan 2024 13:46:40 +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-vk1-f176.google.com with SMTP id 71dfb90a1353d-4b756f2aebeso869735e0c.2 for ; Wed, 03 Jan 2024 05:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704289599; x=1704894399; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iXiRlPNEbOMVVR0getTtwBYLPyTAkQ6ZYT+RkbvnME4=; b=YjxHSvjGY1WmGpBgHWL3O4uUe34GFdQ6d/PgeYtb0RmSVthtTVBlDl60iGqNJaxYXQ RDrnmAlvQFgTvVmHFRYcd4aL6RYk55gKKMd07wukYKU64+ASE0aUbEXj9/Se7zPDlovQ Rr/9jZMHjXyiaMUrtrcmMeGcUIWvB9oZYTt/d4gfvSVNuZh+FyLkTInRHCC1MHjfcTD1 BS9XAyLZPP72ISsRzz4PrGqGW2WmqrXMUnJ4h16vZ35H1qvtRXdt+Q855LoIWqXxuSVC MJOcQOCJIZ15C/ab9vAV9peAHlYdBRHXtPJno/PlWKzeDtigs1Thso2rf32GqIfqcMNv /qaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704289599; x=1704894399; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iXiRlPNEbOMVVR0getTtwBYLPyTAkQ6ZYT+RkbvnME4=; b=T9CG8YJORQiYOXj2+9CM1YuEjbA+wY56LyyG2tKh0jRwMGcMu5pHKp/Iqox6I48ua3 kf3MeYN8maE4RBH2H8VdwyOwUoI4v/yqL37LHlzZGs/YaiJh9aaEPQ9vT2NH8GW9KLpd icwDdQe1KrA+9msub5+k7Ad+76oKsJNUHfNpYbdbirml9oD6zg2EDuUPvdl73j6IY7CB g56A36RK8QPhGVWIZHRwZ5FHjYcLKj5y3fhIzZoWTvGEJcTcpvqyH4ZvhJztXC6ZpAag l3DLb43ylaaW+j1z1I/gmu4N2FH5zvkAi8MrNsWPEue6OTHvjl/BL0ZN36mQthyuqIBl E9tQ== X-Gm-Message-State: AOJu0YyVvHlUK7MJNUUivK82JC4cMQyAO4KWSEQmJ6zZJyj7vZ1Tb+dm GMtU4z51PUctTWThAb1UMU1nGi8HO20v5WLBJRQ5AT4MwHYY X-Received: by 2002:a05:6122:584:b0:4b6:dd06:f707 with SMTP id i4-20020a056122058400b004b6dd06f707mr6623145vko.17.1704289599275; Wed, 03 Jan 2024 05:46:39 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240103090241.164817-1-pierre.gondois@arm.com> <2f4a5ea1-daa2-4ede-bdc0-6692d7d52e8c@arm.com> In-Reply-To: <2f4a5ea1-daa2-4ede-bdc0-6692d7d52e8c@arm.com> From: Marco Elver Date: Wed, 3 Jan 2024 14:46:00 +0100 Message-ID: Subject: Re: [PATCH] list: Add hlist_count_nodes() To: Pierre Gondois Cc: linux-kernel@vger.kernel.org, Kees Cook , Lucas De Marchi , Jani Nikula , Andy Shevchenko , Ingo Molnar Content-Type: text/plain; charset="UTF-8" On Wed, 3 Jan 2024 at 13:04, Pierre Gondois wrote: > > Hello Marco, > > On 1/3/24 12:25, Marco Elver wrote: > > On Wed, 3 Jan 2024 at 10:02, Pierre Gondois wrote: > >> > >> Add a function to count nodes in a hlist. hlist_count_nodes() > >> is similar to list_count_nodes(). > >> > >> Signed-off-by: Pierre Gondois > > > > Is this patch part of another patch series? As-is, this will be dead > > code, and there's no guarantee someone will just go and delete it in > > future. Although this function looks useful, we also should avoid > > adding new dead code. > > The function is indeed not used in the project right now. I needed > it for a private module. If it helps integrating the function and > not make it dead code, maybe I could add usages at the following > places: > - drivers/gpu/drm/drm_hashtab.c::print_binder_node_nilocked() > - drivers/md/bcache/sysfs.c::bch_cache_max_chain() If this function allows to simplify these other places, by all means go ahead. That would look a lot better than having an unused function. Thanks, -- Marco