From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753134AbbLUX7S (ORCPT ); Mon, 21 Dec 2015 18:59:18 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:33069 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbbLUXsH (ORCPT ); Mon, 21 Dec 2015 18:48:07 -0500 From: Al Viro To: linux-kernel@vger.kernel.org Cc: Linus Torvalds Subject: [POC][PATCH 46/83] frv consistent_alloc(): switch page to void * Date: Mon, 21 Dec 2015 23:47:19 +0000 Message-Id: <1450741676-5865-46-git-send-email-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <20151221234615.GW20997@ZenIV.linux.org.uk> References: <20151221234615.GW20997@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Signed-off-by: Al Viro --- 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