]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Add pci_resource_num() helper
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 16 Dec 2024 17:56:17 +0000 (19:56 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 18 Feb 2025 21:40:53 +0000 (15:40 -0600)
commite4728eed24a32f275106c498669a9d3177f9611e
tree0d03fba8b2266204a5322905611e605988c67473
parent2bd0c72117841f7fb82aab7f4a0d65e66ef9543e
PCI: Add pci_resource_num() helper

A few places in PCI code, mainly in setup-bus.c, need to reverse lookup the
index of a resource in pci_dev's resource array. Create pci_resource_num()
helper to avoid repeating the pointer arithmetic trick used to calculate
the index.

Link: https://lore.kernel.org/r/20241216175632.4175-11-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Xiaochun Lee <lixc17@lenovo.com>
drivers/pci/pci.h
drivers/pci/setup-bus.c