From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Subject: Re: [PATCH v2 4/4] pcmcia: Convert to use pci_bus_for_each_resource_p() Date: Fri, 4 Nov 2022 03:29:44 +0900 Message-ID: References: <20221103164644.70554-1-andriy.shevchenko@linux.intel.com> <20221103164644.70554-5-andriy.shevchenko@linux.intel.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane-mx.org@lists.ozlabs.org Sender: "Linuxppc-dev" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andy Shevchenko Cc: linux-pci@vger.kernel.org, Dominik Brodowski , linux-mips@vger.kernel.org, Bjorn Helgaas , sparclinux@vger.kernel.org, Stefano Stabellini , "Rafael J. Wysocki" , Russell King , Bjorn Helgaas , Miguel Ojeda , xen-devel@lists.xenproject.org, Matt Turner , Arnd Bergmann , Richard Henderson , Nicholas Piggin , Ivan Kokshaysky , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , Mika Westerberg , linux-arm-kernel@lists.infradead.org, Juergen Gross , Thomas Bogendoerfer , linux-kernel@vger.kernel.org, Oleksandr Tyshchenko Hello, [...] > > > - > > > - for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) { > > > - res = s->cb_dev->bus->resource[i]; > > > -#else > > > - pci_bus_for_each_resource(s->cb_dev->bus, res, i) { > > > #endif > > > + > > > + pci_bus_for_each_resource_p(s->cb_dev->bus, res) { > > > if (!res) > > > continue; > > > > Doesn't this remove the proper iterator for X86? Even if that is the right > > thing to do, it needs an explict explanation. > > I dunno what was in 2010, but reading code now I have found no differences in > the logic on how resources are being iterated in these two pieces of code. This code is over a decade old (13 years old to be precise) and there was something odd between Bjorn's and Jesse's patches, as per: 89a74ecccd1f ("PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs") cf26e8dc4194 ("pcmcia: do not autoadd root PCI bus resources") > But fine, I will add a line to a commit message about this change. I wouldn't, personally. The change you are proposing is self-explanatory and somewhat in-line with what is there already - unless I am also reading the current implementation wrong. That said, Dominik is the maintainer of PCMCIA driver, so his is the last word, so to speak. :) > Considering this is done, can you issue your conditional tag so I will > incorporate it in v3? No need, really. Again, unless Dominik thinks otherwise. Krzysztof