[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1722e75c-bc06-4a34-5e12-fa3622ed86a3@linaro.org>
Date: Fri, 24 Mar 2023 10:08:39 +0100
From: Philippe Mathieu-Daudé <philmd@...aro.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
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
Cc: 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 23/3/23 18:36, Andy Shevchenko wrote:
> Replace open-coded implementations of pci_resource_n() in pci.h.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> include/linux/pci.h | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 70a4684d5f26..9539cf63fe5e 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -2006,14 +2006,12 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma);
> * for accessing popular PCI BAR info
> */
> #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()".
Here as #6 or as #2:
Reviewed-by: Philippe Mathieu-Daudé <philmd@...aro.org>
Powered by blists - more mailing lists