[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 2/4] PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource()
- To: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
- From: Bjorn Helgaas <helgaas@xxxxxxxxxx>
- Date: Wed, 22 Mar 2023 14:35:25 -0500
- Cc: Mickaël Salaün <mic@xxxxxxxxxxx>, Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>, Krzysztof Wilczyński <kw@xxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Niklas Schnelle <schnelle@xxxxxxxxxxxxx>, "Rafael J. Wysocki" <rafael.j.wysocki@xxxxxxxxx>, Pali Rohár <pali@xxxxxxxxxx>, "Maciej W. Rozycki" <macro@xxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, Miguel Ojeda <ojeda@xxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Andrew Lunn <andrew@xxxxxxx>, Sebastian Hesselbarth <sebastian.hesselbarth@xxxxxxxxx>, Gregory Clement <gregory.clement@xxxxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Christophe Leroy <christophe.leroy@xxxxxxxxxx>, Anatolij Gustschin <agust@xxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Rich Felker <dalias@xxxxxxxx>, John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
- Delivery-date: Wed, 22 Mar 2023 19:35:45 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Mar 20, 2023 at 03:16:31PM +0200, Andy Shevchenko wrote:
> ...
> -#define pci_bus_for_each_resource(bus, res, i)
> \
> - for (i = 0; \
> - (res = pci_bus_resource_n(bus, i)) || i < PCI_BRIDGE_RESOURCE_NUM; \
> - i++)
> +#define __pci_bus_for_each_resource(bus, res, __i, vartype)
> \
> + for (vartype __i = 0;
> \
> + res = pci_bus_resource_n(bus, __i), __i < PCI_BRIDGE_RESOURCE_NUM;
> \
> + __i++)
> +
> +#define pci_bus_for_each_resource(bus, res, i)
> \
> + __pci_bus_for_each_resource(bus, res, i, )
> +
> +#define pci_bus_for_each_resource_p(bus, res)
> \
> + __pci_bus_for_each_resource(bus, res, __i, unsigned int)
I like these changes a lot, too!
Same comments about _p vs _idx and __pci_bus_for_each_resource(...,
vartype).
Also would prefer 80 char max instead of 81.
|