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>] [day] [month] [year] [list]
Message-Id: <1511392118-24101-1-git-send-email-gomonovych@gmail.com>
Date:   Thu, 23 Nov 2017 00:08:38 +0100
From:   Vasyl Gomonovych <gomonovych@...il.com>
To:     jhogan@...nel.org, dledford@...hat.com, akpm@...ux-foundation.org,
        bart.vanassche@...disk.com, alexander.h.duyck@...el.com,
        linux-metag@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, gomonovych@...il.com
Subject: [PATCH] metag: Use vma_pages helper in dma_mmap

Use vma_pages function on vma object instead of explicit computation.
arch/metag/kernel/dma.c:345:19-25: 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/metag/kernel/dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/metag/kernel/dma.c b/arch/metag/kernel/dma.c
index f0ab3a498328..49a3b843ef9f 100644
--- a/arch/metag/kernel/dma.c
+++ b/arch/metag/kernel/dma.c
@@ -342,7 +342,7 @@ static int metag_dma_mmap(struct device *dev, struct vm_area_struct *vma,
 	else
 		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
-	user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+	user_size = vma_pages(vma);
 
 	spin_lock_irqsave(&consistent_lock, flags);
 	c = metag_vm_region_find(&consistent_head, (unsigned long)cpu_addr);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ