From: Miles Chen Date: Thu, 16 Nov 2017 01:32:10 +0000 (-0800) Subject: mm/slob.c: remove an unnecessary check for __GFP_ZERO X-Git-Tag: microblaze-4.16-rc1~339^2~115 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=9f88faee3ff7d6e8b09c9d23b7d4ac0c15a3eae9;p=linux-2.6-microblaze.git mm/slob.c: remove an unnecessary check for __GFP_ZERO Current flow guarantees a valid pointer when handling the __GFP_ZERO case. So remove the unnecessary NULL pointer check. Link: http://lkml.kernel.org/r/1507203141-11959-1-git-send-email-miles.chen@mediatek.com Signed-off-by: Miles Chen Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/slob.c b/mm/slob.c index 10249160b693..3451ecad8e35 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -330,7 +330,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; }