From: Yi Wang <wang.yi59@zte.com.cn>
To: cl@linux.com
Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn,
wang.yi59@zte.com.cn, wang.liang82@zte.com.cn,
Liao Pingfang <liao.pingfang@zte.com.cn>
Subject: [PATCH] mm, slab: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
Date: Wed, 17 Jun 2020 15:15:56 +0800 [thread overview]
Message-ID: <1592378156-7748-1-git-send-email-wang.yi59@zte.com.cn> (raw)
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
next reply other threads:[~2020-06-17 7:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 7:15 Yi Wang [this message]
2020-06-17 10:43 ` [PATCH] mm, slab: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO Vlastimil Babka
2020-06-17 11:18 ` kernel test robot
2020-06-17 23:40 ` kernel test robot
2020-06-17 7:16 Alexey Dobriyan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1592378156-7748-1-git-send-email-wang.yi59@zte.com.cn \
--to=wang.yi59@zte.com.cn \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=liao.pingfang@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=wang.liang82@zte.com.cn \
--cc=xue.zhihong@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).