From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BDA2C4332F for ; Mon, 14 Nov 2022 17:58:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237690AbiKNR5g (ORCPT ); Mon, 14 Nov 2022 12:57:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237844AbiKNR5Y (ORCPT ); Mon, 14 Nov 2022 12:57:24 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFC0B25EBA; Mon, 14 Nov 2022 09:57:22 -0800 (PST) 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="310746983" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="310746983" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.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> 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 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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