From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yi Wang <wang.yi59@zte.com.cn>, steffen.klassert@secunet.com
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
xue.zhihong@zte.com.cn, up2wing@gmail.com,
wang.liang82@zte.com.cn, Huang Zijiang <huang.zijiang@zte.com.cn>
Subject: Re: [PATCH] xfrm: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
Date: Mon, 23 Dec 2019 12:36:22 +0300 [thread overview]
Message-ID: <1d8007f1-15ab-a173-a3ed-cf2235cd2cea@cogentembedded.com> (raw)
In-Reply-To: <1577065982-25751-1-git-send-email-wang.yi59@zte.com.cn>
Hello!
On 23.12.2019 4:53, Yi Wang wrote:
> From: Huang Zijiang <huang.zijiang@zte.com.cn>
>
> Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc
> with flag GFP_ZERO since kzalloc sets allocated memory
> to zero.
>
> Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn>
> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> ---
> net/xfrm/xfrm_state.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> index a5dc319..adfa279 100644
> --- a/net/xfrm/xfrm_state.c
> +++ b/net/xfrm/xfrm_state.c
> @@ -612,7 +612,7 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
> {
> struct xfrm_state *x;
>
> - x = kmem_cache_alloc(xfrm_state_cache, GFP_ATOMIC | __GFP_ZERO);
> +x = kmem_cache_zalloc(xfrm_state_cache, GFP_ATOMIC);
You ate the indentation. :-)
[...]
MBR, Sergei
next prev parent reply other threads:[~2019-12-23 9:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-23 1:53 [PATCH] xfrm: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO Yi Wang
2019-12-23 9:36 ` Sergei Shtylyov [this message]
2020-02-12 9:54 Yi Wang
2020-02-20 12:44 ` Steffen Klassert
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=1d8007f1-15ab-a173-a3ed-cf2235cd2cea@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=huang.zijiang@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=up2wing@gmail.com \
--cc=wang.liang82@zte.com.cn \
--cc=wang.yi59@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).