aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2015-07-03 01:10:43 -0400
committerVineet Gupta <vgupta@synopsys.com>2015-07-06 01:39:01 -0400
commitf718c2efff0b0460e5335607a1c6caf620847680 (patch)
treee32b70ab3aced772db554ab870c6ba64fda33650
parent97709069214eb75312c14946803b9da4d3814203 (diff)
ARC: Don't memzero twice in dma_alloc_coherent for __GFP_ZERO
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>
-rw-r--r--arch/arc/mm/dma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c
index 74a637a1cfc4..57706a9c6948 100644
--- a/arch/arc/mm/dma.c
+++ b/arch/arc/mm/dma.c
@@ -60,8 +60,8 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
60 60
61 /* This is kernel Virtual address (0x7000_0000 based) */ 61 /* This is kernel Virtual address (0x7000_0000 based) */
62 kvaddr = ioremap_nocache((unsigned long)paddr, size); 62 kvaddr = ioremap_nocache((unsigned long)paddr, size);
63 if (kvaddr != NULL) 63 if (kvaddr == NULL)
64 memset(kvaddr, 0, size); 64 return NULL;
65 65
66 /* This is bus address, platform dependent */ 66 /* This is bus address, platform dependent */
67 *dma_handle = (dma_addr_t)paddr; 67 *dma_handle = (dma_addr_t)paddr;