lkml.org 
[lkml]   [2017]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/slob: remove an unnecessary check for __GFP_ZERO
Date
From: Miles Chen <miles.chen@mediatek.com>

Current flow guarantees a valid pointer when handling
the __GFP_ZERO case. So remove the unnecessary NULL pointer
check.

Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
mm/slob.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slob.c b/mm/slob.c
index a8bd6fa..a72649c 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -329,7 +329,7 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node)
BUG_ON(!b);
spin_unlock_irqrestore(&slob_lock, flags);
}
- if (unlikely((gfp & __GFP_ZERO) && b))
+ if (unlikely(gfp & __GFP_ZERO))
memset(b, 0, size);
return b;
}
--
1.9.1
\
 
 \ /
  Last update: 2017-10-05 13:33    [W:0.026 / U:9.872 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site