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 F1628C76196 for ; Thu, 23 Mar 2023 15:12:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232040AbjCWPMt (ORCPT ); Thu, 23 Mar 2023 11:12:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbjCWPMd (ORCPT ); Thu, 23 Mar 2023 11:12:33 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED1A1298F9; Thu, 23 Mar 2023 08:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679584343; x=1711120343; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pTI3sfGhxuNt+eJ92X/zV2v4CxfKcZ1sf1RhNp36ij0=; b=VbJ+jeUUPtbfIJVah3l5bMjlknrA4fMoJQERYl/KBk7p0Ka+FbggX2ku uC94mWBiUeYVqeeKso06aXK5DLmeoChTk+UKL2ajM4N3rTbukWzVRkW+A UsZ+ziQqstgxuPwyrAlqppaC/S/SJ5geUat5yX2NDimGcNga0c+LLTWR6 R0gPSZ6ECeUbE6G2tyDL6/QYDnWR8h8XJ7wKJvGWTaUSy81rIlnENooqA beSut6QYqTfXQmwIuuFIequ1Pz2OAcuTqYHrZiasYTAwBQneRVXCFQUfN De66VgFyZC/HoI5tIZQPlZYtr+ArY7b0xdZVBa62oooMx+izq3uV4BeGo g==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="404419881" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="404419881" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 08:09:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="793046100" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="793046100" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP; 23 Mar 2023 08:08:52 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pfMYZ-007YBs-1j; Thu, 23 Mar 2023 17:08:47 +0200 Date: Thu, 23 Mar 2023 17:08:47 +0200 From: Andy Shevchenko To: Bjorn Helgaas Cc: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Mika Westerberg , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Michael Ellerman , Randy Dunlap , Arnd Bergmann , Niklas Schnelle , "Rafael J. Wysocki" , Pali =?iso-8859-1?Q?Roh=E1r?= , "Maciej W. Rozycki" , Juergen Gross , Dominik Brodowski , linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, Miguel Ojeda , Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Thomas Bogendoerfer , Nicholas Piggin , Christophe Leroy , Anatolij Gustschin , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S. Miller" , Bjorn Helgaas , Stefano Stabellini , Oleksandr Tyshchenko Subject: Re: [PATCH v6 1/4] PCI: Introduce pci_dev_for_each_resource() Message-ID: References: <20230323150238.GA2550157@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230323150238.GA2550157@bhelgaas> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Mar 23, 2023 at 10:02:38AM -0500, Bjorn Helgaas wrote: > On Thu, Mar 23, 2023 at 04:30:01PM +0200, Andy Shevchenko wrote: ... > I poked around looking for similar patterns elsewhere with: > > git grep "#define.*for_each_.*_p(" > git grep "#define.*for_each_.*_idx(" > > I didn't find any other "_p" iterators and just a few "_idx" ones, so > my hope is to follow what little precedent there is, as well as > converge on the basic "*_for_each_resource()" iterators and remove the > "_idx()" versions over time by doing things like the > pci_claim_resource() change. The p is heavily used in the byte order conversion helpers. > What do you think? If it seems like excessive churn, we can do it > as-is and still try to reduce the use of the index variable over time. I think _p has a precedent as well. But I can think about it a bit, maybe we can come up with something smarter. -- With Best Regards, Andy Shevchenko