linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, slab: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
@ 2020-06-17  7:15 Yi Wang
  2020-06-17 10:43 ` Vlastimil Babka
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yi Wang @ 2020-06-17  7:15 UTC (permalink / raw)
  To: cl
  Cc: penberg, rientjes, iamjoonsoo.kim, akpm, linux-mm, linux-kernel,
	xue.zhihong, wang.yi59, wang.liang82, Liao Pingfang

From: Liao Pingfang <liao.pingfang@zte.com.cn>

Use kmem_cache_zalloc instead of manually calling kmem_cache_alloc
with flag GFP_ZERO.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
---
 include/linux/slab.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/slab.h b/include/linux/slab.h
index 6d45488..1fa62d9 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -656,7 +656,7 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long);
  */
 static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags)
 {
-	return kmem_cache_alloc(k, flags | __GFP_ZERO);
+	return kmem_cache_zalloc(k, flags);
 }
 
 /**
-- 
2.9.5



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

end of thread, other threads:[~2020-06-17 23:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17  7:15 [PATCH] mm, slab: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO Yi Wang
2020-06-17 10:43 ` Vlastimil Babka
2020-06-17 11:18 ` kernel test robot
2020-06-17 23:40 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).