lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <705681db-b38d-95bd-7986-0c4bfdaf02de@arm.com>
Date:   Wed, 22 Nov 2017 15:26:40 +0000
From:   Vladimir Murzin <vladimir.murzin@....com>
To:     Vasyl Gomonovych <gomonovych@...il.com>, linux@...linux.org.uk,
        jroedel@...e.de, linux-arm-kernel@...ts.infradead.org,
        sricharan@...eaurora.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ARM: dma-mapping: Use vma_pages helper

On 22/11/17 15:20, Vasyl Gomonovych wrote:
> Use vma_pages function on vma object instead of explicit computation.
> arch/arm/mm/dma-mapping.c:849:36-42: WARNING: Consider using vma_pages helper on vma
> Generated by: scripts/coccinelle/api/vma_pages.cocci
> 
> Signed-off-by: Vasyl Gomonovych <gomonovych@...il.com>
> ---
>  arch/arm/mm/dma-mapping.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index fcf1473d6fed..855427620b01 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -846,7 +846,7 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
>  		 unsigned long attrs)
>  {
>  	int ret;
> -	unsigned long nr_vma_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
> +	unsigned long nr_vma_pages = vma_pages(vma);
>  	unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
>  	unsigned long pfn = dma_to_pfn(dev, dma_addr);
>  	unsigned long off = vma->vm_pgoff;
> 

Colin already submitted similar patch a couple days ago [1].

[1] https://lkml.org/lkml/2017/11/19/322

Vladimir

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ