From: Miles Chen <miles.chen@xxxxxxxxxxxx> Subject: 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@xxxxxxxxxxxx Signed-off-by: Miles Chen <miles.chen@xxxxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/slob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/slob.c~mm-slob-remove-an-unnecessary-check-for-__gfp_zero mm/slob.c --- a/mm/slob.c~mm-slob-remove-an-unnecessary-check-for-__gfp_zero +++ a/mm/slob.c @@ -330,7 +330,7 @@ static void *slob_alloc(size_t size, gfp 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; } _ -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html