[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZAusCnLSXeEcpQs+@kbusch-mbp.dhcp.thefacebook.com>
Date: Fri, 10 Mar 2023 15:15:38 -0700
From: Keith Busch <kbusch@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
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>,
Bjorn Helgaas <helgaas@...nel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Niklas Schnelle <schnelle@...ux.ibm.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 v4 1/4] PCI: Introduce pci_dev_for_each_resource()
On Fri, Mar 10, 2023 at 07:14:13PM +0200, Andy Shevchenko wrote:
> +#define __pci_dev_for_each_resource(dev, res, __i, vartype) \
> + for (vartype __i = 0; \
> + res = &(dev)->resource[__i], __i < PCI_NUM_RESOURCES; \
> + __i++)
...
> +#define pci_dev_for_each_resource_p(dev, res) \
> + __pci_dev_for_each_resource(dev, res, i, unsigned int)
It looks dangerous to have a macro declare a variable when starting a new
scope. How do you know the name 'i' won't clash with something defined above?
Powered by blists - more mailing lists