[PATCH 2/2] PCI: dwc: Add multi-port controller support
Niklas Cassel
cassel at kernel.org
Tue Jan 6 03:16:16 PST 2026
On Tue, Jan 06, 2026 at 11:55:46AM +0100, Niklas Cassel wrote:
> For iterating, to avoid manually traversing the array, we could do like
> libata and create a simple macro, e.g. ata_qc_for_each():
> https://github.com/torvalds/linux/blob/v6.19-rc4/drivers/ata/libata-eh.c#L851-L854
> https://github.com/torvalds/linux/blob/v6.19-rc4/include/linux/libata.h#L1657-L1659
>
> And at least personally, I think my brain will parse dw_pcie_port_for_each() { }
> faster than it parses list_for_each_entry(port, &pcie->ports, list) { },
> since it is more unique, but perhaps I am the weird one here :)
Or... for_each_dw_pcie_port()
We also don't need to supply an integer to the macro, we could do like e.g.
for_each_nhlt_endpoint():
https://github.com/torvalds/linux/blob/v6.19-rc4/include/acpi/nhlt.h#L63-L64
which has does "for (unsigned int __i = 0; " in the macro.
Kind regards,
Niklas
More information about the linux-amlogic
mailing list