Re: [PATCH v6 2/4] PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource()

From
Bjorn Helgaas <helgaas@kernel.org>
Date
2023-03-22 19:35:33
Also in
linux-acpi, linux-alpha, linux-arm-kernel, linux-mips, linux-pci, linux-sh, lkml, sparclinux, xen-devel
Reply to
Andy Shevchenko, 2023-03-20
On Mon, Mar 20, 2023 at 03:16:31PM +0200, Andy Shevchenko wrote:
...
quoted hunk ↗ jump to hunk
-#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.
Thread (11 messages) 11 messages, 3 authors, last reply 2023-03-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help