Browse Source

sh: Use __GFP_ZERO for dma_generic_alloc_coherent().

This follows the x86 change off of memset() and on to an unconditional
__GFP_ZERO for wrapping in to optimized page clearing by way of
clear_highpage().

Signed-off-by: Andrew Murray <amurray@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Andrew Murray 15 years ago
parent
commit
57682827b9
1 changed files with 2 additions and 1 deletions
  1. 2 1
      arch/sh/mm/consistent.c

+ 2 - 1
arch/sh/mm/consistent.c

@@ -38,11 +38,12 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
 	void *ret, *ret_nocache;
 	void *ret, *ret_nocache;
 	int order = get_order(size);
 	int order = get_order(size);
 
 
+	gfp |= __GFP_ZERO;
+
 	ret = (void *)__get_free_pages(gfp, order);
 	ret = (void *)__get_free_pages(gfp, order);
 	if (!ret)
 	if (!ret)
 		return NULL;
 		return NULL;
 
 
-	memset(ret, 0, size);
 	/*
 	/*
 	 * Pages from the page allocator may have data present in
 	 * Pages from the page allocator may have data present in
 	 * cache. So flush the cache before using uncached memory.
 	 * cache. So flush the cache before using uncached memory.