Re: [PATCH 12/20] alpha/PCI: Use PCI resource accessor macros

Ilpo Järvinen
2026-04-10T11:11:32Z

[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]

On Fri, 10 Apr 2026, Krzysztof Wilczyński wrote:

> Replace direct pdev->resource[] accesses with pci_resource_n(),
> and pdev->resource[].flags accesses with pci_resource_flags().
>
> No functional changes intended.
>
> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
> ---
> arch/alpha/kernel/pci-sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c
> index c84867ce31f5..7aac5e76dcd6 100644
> --- a/arch/alpha/kernel/pci-sysfs.c
> +++ b/arch/alpha/kernel/pci-sysfs.c
> @@ -141,7 +141,7 @@ static int sparse_mem_mmap_fits(struct pci_dev *pdev, int num)
> long dense_offset;
> unsigned long sparse_size;
>
> - pcibios_resource_to_bus(pdev->bus, &bar, &pdev->resource[num]);
> + pcibios_resource_to_bus(pdev->bus, &bar, pci_resource_n(pdev, num));
>
> /* All core logic chips have 4G sparse address space, except
> CIA which has 16G (see xxx_SPARSE_MEM and xxx_DENSE_MEM
> @@ -181,7 +181,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num)
> suffix = ""; /* Assume bwx machine, normal resourceN files. */
> nlen1 = 10;
>
> - if (pdev->resource[num].flags & IORESOURCE_MEM) {
> + if (pci_resource_flags(pdev, num) & IORESOURCE_MEM) {

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

I started wonder though if we'd want to add pci_resource_is_mem/io()
shortcuts for these, as it's largely what

git grep pci_resource_flags

results contain.

--
i.