[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZB1rdkOgwwSC2Pxf@smile.fi.intel.com>
Date: Fri, 24 Mar 2023 11:20:54 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Philippe Mathieu-Daudé <philmd@...aro.org>
Cc: Mickaël Salaün <mic@...ikod.net>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Krzysztof Wilczyński <kw@...ux.com>,
Michael Ellerman <mpe@...erman.id.au>,
Randy Dunlap <rdunlap@...radead.org>,
Arnd Bergmann <arnd@...db.de>,
Niklas Schnelle <schnelle@...ux.ibm.com>,
Bjorn Helgaas <helgaas@...nel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Pali Rohár <pali@...nel.org>,
"Maciej W. Rozycki" <macro@...am.me.uk>,
Juergen Gross <jgross@...e.com>,
Dominik Brodowski <linux@...inikbrodowski.net>,
linux-kernel@...r.kernel.org, linux-alpha@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-mips@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-sh@...r.kernel.org,
sparclinux@...r.kernel.org, linux-pci@...r.kernel.org,
xen-devel@...ts.xenproject.org, linux-acpi@...r.kernel.org,
Miguel Ojeda <ojeda@...nel.org>,
Richard Henderson <richard.henderson@...aro.org>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>,
Russell King <linux@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Gregory Clement <gregory.clement@...tlin.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Anatolij Gustschin <agust@...x.de>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
"David S. Miller" <davem@...emloft.net>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>
Subject: Re: [PATCH v7 6/6] PCI: Make use of pci_resource_n()
On Fri, Mar 24, 2023 at 10:08:39AM +0100, Philippe Mathieu-Daudé wrote:
> On 23/3/23 18:36, Andy Shevchenko wrote:
> > Replace open-coded implementations of pci_resource_n() in pci.h.
...
> > #define pci_resource_n(dev, bar) (&(dev)->resource[(bar)])
> > -#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
> > -#define pci_resource_end(dev, bar) ((dev)->resource[(bar)].end)
> > -#define pci_resource_flags(dev, bar) ((dev)->resource[(bar)].flags)
> > -#define pci_resource_len(dev,bar) \
> > - ((pci_resource_end((dev), (bar)) == 0) ? 0 : \
> > - \
> > - (pci_resource_end((dev), (bar)) - \
> > - pci_resource_start((dev), (bar)) + 1))
> > +#define pci_resource_start(dev, bar) (pci_resource_n(dev, bar)->start)
> > +#define pci_resource_end(dev, bar) (pci_resource_n(dev, bar)->end)
> > +#define pci_resource_flags(dev, bar) (pci_resource_n(dev, bar)->flags)
> > +#define pci_resource_len(dev,bar) \
> > + (pci_resource_end((dev), (bar)) ? \
> > + resource_size(pci_resource_n((dev), (bar))) : 0)
>
> Seems (to me) more logical to have this patch as "PCI: Introduce
> pci_resource_n()" ordered before your patch #2 "PCI: Introduce
> pci_dev_for_each_resource()".
Either way works for me. Bjorn, what do you like?
> Here as #6 or as #2:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@...aro.org>
Thank you!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists