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

Ilpo Järvinen <[email protected]>
Newsgroups org.kernel.vger.linux-alpha,org.kernel.vger.linux-pci,org.ozlabs.lists.linuxppc-dev
Message-ID <[email protected]>
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 <[email protected]>
> ---
>  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 <[email protected]>

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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.