Re: [PATCH v4 16/24] alpha/PCI: Remove WARN from __pci_mmap_fits()

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 Sat, 11 Apr 2026, Krzysztof Wilczyński wrote:

> Remove the WARN() that fires when userspace attempts to mmap beyond
> the BAR bounds.  The check still returns 0 to reject the mapping,
> but the warning is excessive for normal operation.
> 
> A similar warning was removed from the PCI core in the commit
> 3b519e4ea618 ("PCI: fix size checks for mmap() on /proc/bus/pci files").
> 
> Signed-off-by: Krzysztof Wilczyński <[email protected]>
> ---
>  arch/alpha/kernel/pci-sysfs.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c
> index 2748000a7486..c136603ddf2c 100644
> --- a/arch/alpha/kernel/pci-sysfs.c
> +++ b/arch/alpha/kernel/pci-sysfs.c
> @@ -48,13 +48,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
>  	start = vma->vm_pgoff;
>  	size = ((len - 1) >> (PAGE_SHIFT - shift)) + 1;
>  
> -	if (start < size && size - start >= nr)
> -		return 1;
> -	WARN(1, "process \"%s\" tried to map%s 0x%08lx-0x%08lx on %s BAR %d "
> -		"(size 0x%08lx)\n",
> -		current->comm, sparse ? " sparse" : "", start, start + nr,
> -		pci_name(pdev), num, size);
> -	return 0;
> +	return start < size && size - start >= nr;
>  }
>  
>  /**
> 

Reviewed-by: Ilpo Järvinen <[email protected]>

-- 
 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.