[tip:core/locking] sh: Use __GFP_ZERO for dma_generic_alloc_coherent().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  57682827b9a5edb52e33af0be9082b51bffcd5c7
Gitweb:     http://git.kernel.org/tip/57682827b9a5edb52e33af0be9082b51bffcd5c7
Author:     Andrew Murray <amurray@xxxxxxxxxxxxxx>
AuthorDate: Wed, 4 Aug 2010 16:38:35 +0900
Committer:  Paul Mundt <lethal@xxxxxxxxxxxx>
CommitDate: Wed, 4 Aug 2010 16:38:35 +0900

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@xxxxxxxxxxxxxx>
Signed-off-by: Paul Mundt <lethal@xxxxxxxxxxxx>
---
 arch/sh/mm/consistent.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index c86a085..0387932 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -38,11 +38,12 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
 	void *ret, *ret_nocache;
 	int order = get_order(size);
 
+	gfp |= __GFP_ZERO;
+
 	ret = (void *)__get_free_pages(gfp, order);
 	if (!ret)
 		return NULL;
 
-	memset(ret, 0, size);
 	/*
 	 * Pages from the page allocator may have data present in
 	 * cache. So flush the cache before using uncached memory.
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux