All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/slob: remove an unnecessary check for __GFP_ZERO
@ 2017-10-05 11:32 ` miles.chen
  0 siblings, 0 replies; 2+ messages in thread
From: miles.chen @ 2017-10-05 11:32 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton
  Cc: linux-kernel, linux-mm, wsd_upstream, linux-mediatek, Miles Chen

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] mm/slob: remove an unnecessary check for __GFP_ZERO
@ 2017-10-05 11:32 ` miles.chen
  0 siblings, 0 replies; 2+ messages in thread
From: miles.chen @ 2017-10-05 11:32 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton
  Cc: linux-kernel, linux-mm, wsd_upstream, linux-mediatek, Miles Chen

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

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-05 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 11:32 [PATCH] mm/slob: remove an unnecessary check for __GFP_ZERO miles.chen
2017-10-05 11:32 ` miles.chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.