]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARC: Don't memzero twice in dma_alloc_coherent for __GFP_ZERO
authorVineet Gupta <vgupta@synopsys.com>
Fri, 3 Jul 2015 05:10:43 +0000 (10:40 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 6 Jul 2015 05:39:01 +0000 (11:09 +0530)
alloc_pages_exact() get gfp flags and handle zero'ing already

And while it, fix the case where ioremap fails: return rightaway.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/mm/dma.c

index 74a637a1cfc48b2c5d4f0047a0b25bc51d238e16..57706a9c69489791df22419ec069c1970d1aa634 100644 (file)
@@ -60,8 +60,8 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
 
        /* This is kernel Virtual address (0x7000_0000 based) */
        kvaddr = ioremap_nocache((unsigned long)paddr, size);
-       if (kvaddr != NULL)
-               memset(kvaddr, 0, size);
+       if (kvaddr == NULL)
+               return NULL;
 
        /* This is bus address, platform dependent */
        *dma_handle = (dma_addr_t)paddr;