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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 21 Dec 2015 23:47:19 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	linux-kernel@...r.kernel.org
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [POC][PATCH 46/83] frv consistent_alloc(): switch page to void *

From: Al Viro <viro@...iv.linux.org.uk>

Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
 arch/frv/mm/dma-alloc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c
index c4c19ff..62268e1 100644
--- a/arch/frv/mm/dma-alloc.c
+++ b/arch/frv/mm/dma-alloc.c
@@ -81,7 +81,8 @@ static int map_page(unsigned long va, unsigned long pa, pgprot_t prot)
 void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
 {
 	struct vm_struct *area;
-	unsigned long page, va, pa;
+	unsigned long va, pa;
+	void *page;
 	void *ret;
 	int order, err, i;
 
@@ -92,7 +93,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
 	size = PAGE_ALIGN(size);
 	order = get_order(size);
 
-	page = __get_free_pages(gfp, order);
+	page = (void *)__get_free_pages(gfp, order);
 	if (!page) {
 		BUG();
 		return NULL;
@@ -101,14 +102,14 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
 	/* allocate some common virtual space to map the new pages */
 	area = get_vm_area(size, VM_ALLOC);
 	if (area == 0) {
-		free_pages((void *)page, order);
+		free_pages(page, order);
 		return NULL;
 	}
 	va = VMALLOC_VMADDR(area->addr);
 	ret = (void *) va;
 
 	/* this gives us the real physical address of the first page */
-	*dma_handle = pa = virt_to_bus((void *) page);
+	*dma_handle = pa = virt_to_bus(page);
 
 	/* set refcount=1 on all pages in an order>0 allocation so that vfree() will actually free
 	 * all pages that were allocated.
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists