diff mbox

cris: cryptocop: fix GFP_ATOMIC macro usage

Message ID 1389948438-26437-1-git-send-email-m.szyprowski@samsung.com
State New
Headers show

Commit Message

Marek Szyprowski Jan. 17, 2014, 8:47 a.m. UTC
GFP_ATOMIC is not a single gfp flag, but a macro which expands to the other
flags and LACK of __GFP_WAIT flag. To check if caller wanted to perform an
atomic allocation, the code must test __GFP_WAIT flag presence.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/cris/arch-v32/drivers/cryptocop.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index 877da19..7f2e60a 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -306,7 +306,7 @@  static void free_cdesc(struct cryptocop_dma_desc *cdesc)
 
 static struct cryptocop_dma_desc *alloc_cdesc(int alloc_flag)
 {
-	int use_pool = (alloc_flag & GFP_ATOMIC) ? 1 : 0;
+	int use_pool = (alloc_flag & __GFP_WAIT) ? 0 : 1;
 	struct cryptocop_dma_desc *cdesc;
 
 	if (use_pool) {