Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 1318B79F3 for ; Mon, 14 Nov 2022 17:57:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668448643; x=1699984643; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Cc3hg2VIM6L+Sab51F6eBaTWDmyo6t4XvJHG+xF3G0U=; b=KtdNY1sXkyV/Xc+Avm4b9uu2Czba0SM3YPIdhar0OrgbmTTB0SgSsTj7 qMEvdIzC8gyL+wP9XlioFMIzlRXsxEkuEGxYOYySNW2sHt/U1GmqwAKTT OTPE5uMJYrqD89mak15ydH6W76eucLfJfG6vJ4tYuWQ4AcsEmDOzUtkJ5 jzK7lgaNyaO7QwFahmemv5Upj0WoFNUOdNfeVh+mG1YkpMxafzxtIVsxm J3Jj4jU5AwyiPcfa/VwrRTUXMkINGBHz0iLyb0wP1mzJKKnrcpj92/c1U x0e9K9c+XdefShCr66OFa5bCrsJQbNWo9YBmQe8caZktpb6M9mdiBM3GC Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="376304431" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="376304431" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 09:57:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="671657096" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="671657096" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga001.jf.intel.com with ESMTP; 14 Nov 2022 09:57:19 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oudhs-00CHlc-2X; Mon, 14 Nov 2022 19:57:16 +0200 Date: Mon, 14 Nov 2022 19:57:16 +0200 From: Andy Shevchenko To: Matthew Wilcox Cc: kernel test robot , Jakob Koschel , Greg Kroah-Hartman , Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, oe-kbuild-all@lists.linux.dev, Kevin Cernekee , Andrew Morton , Linux Memory Management List Subject: Re: [PATCH v1 1/4] list: Introduce list_count() to count existing nodes Message-ID: References: <20221114112842.38565-1-andriy.shevchenko@linux.intel.com> <202211142350.i0ngTfIl-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Nov 14, 2022 at 05:47:21PM +0000, Matthew Wilcox wrote: > On Mon, Nov 14, 2022 at 06:03:00PM +0200, Andy Shevchenko wrote: > > Oh, nice! I will fix this for v2. > > list_count() is an antipattern. I don't have any of the patches in > my inbox, so maybe there's a great reason for doing this, but my > immediate response is: NAK. When we are trying to hide iterator variable in many cases, leaving the current code alive will allow explicit access to it. If it's not a problem, why to bother with the other list APIs then? -- With Best Regards, Andy Shevchenko