From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753428AbbLUX4u (ORCPT ); Mon, 21 Dec 2015 18:56:50 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:33078 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752336AbbLUXsI (ORCPT ); Mon, 21 Dec 2015 18:48:08 -0500 From: Al Viro To: linux-kernel@vger.kernel.org Cc: Linus Torvalds Subject: [POC][PATCH 51/83] microblaze consistent_alloc(): get rid of pointless casts Date: Mon, 21 Dec 2015 23:47:24 +0000 Message-Id: <1450741676-5865-51-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/microblaze/mm/consistent.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/microblaze/mm/consistent.c b/arch/microblaze/mm/consistent.c index a4b587a..bdeb2cb 100644 --- a/arch/microblaze/mm/consistent.c +++ b/arch/microblaze/mm/consistent.c @@ -61,8 +61,8 @@ */ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle) { - unsigned long order, vaddr; - void *ret; + unsigned long order; + void *vaddr, *ret; unsigned int i, err = 0; struct page *page, *end; @@ -79,7 +79,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle) size = PAGE_ALIGN(size); order = get_order(size); - vaddr = __get_free_pages(gfp, order); + vaddr = (void *)__get_free_pages(gfp, order); if (!vaddr) return NULL; @@ -87,11 +87,11 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle) * we need to ensure that there are no cachelines in use, * or worse dirty in this area. */ - flush_dcache_range(virt_to_phys((void *)vaddr), - virt_to_phys((void *)vaddr) + size); + flush_dcache_range(virt_to_phys(vaddr), + virt_to_phys(vaddr) + size); #ifndef CONFIG_MMU - ret = (void *)vaddr; + ret = vaddr; /* * Here's the magic! Note if the uncached shadow is not implemented, * it's up to the calling code to also test that condition and make @@ -110,14 +110,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) { - free_pages((void *)vaddr, order); + free_pages(vaddr, order); return NULL; } va = (unsigned long) area->addr; ret = (void *)va; /* This gives us the real physical address of the first page. */ - *dma_handle = pa = __virt_to_phys(vaddr); + *dma_handle = pa = __pa(vaddr); #endif /* @@ -148,7 +148,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle) } if (err) { - free_pages((void *)vaddr, order); + free_pages(vaddr, order); return NULL; } -- 2.1.4