Skip to contentSkip to conversation

mm/slob: remove an unnecessary check for __GFP_ZERO

PATCH Applied [email protected] 1 participant 1 message Oct 5, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/slob: remove an unnecessary check for __GFP_ZERO

From: Miles Chen <[email protected]>

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

---
 mm/slob.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/slob.c +1 -1
index a8bd6fa..a72649c 100644
@@ -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;
 }
Signature · 7 lines
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>