From: Andy Grover <andy.grover@oracle.com>
To: Wei Yongjun <yjwei@cn.fujitsu.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
Date: Thu, 09 Apr 2009 10:43:13 -0700 [thread overview]
Message-ID: <49DE33B1.4010700@oracle.com> (raw)
In-Reply-To: <49DDAB8A.5000300@cn.fujitsu.com>
Wei Yongjun wrote:
> Use kmem_cache_zalloc instead of kmem_cache_alloc/memset.
>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
> ---
> net/rds/connection.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/net/rds/connection.c b/net/rds/connection.c
> index 273f064..d14445c 100644
> --- a/net/rds/connection.c
> +++ b/net/rds/connection.c
> @@ -148,14 +148,12 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
> if (conn)
> goto out;
>
> - conn = kmem_cache_alloc(rds_conn_slab, gfp);
> + conn = kmem_cache_zalloc(rds_conn_slab, gfp);
> if (conn == NULL) {
> conn = ERR_PTR(-ENOMEM);
> goto out;
> }
>
> - memset(conn, 0, sizeof(*conn));
> -
> INIT_HLIST_NODE(&conn->c_hash_node);
> conn->c_version = RDS_PROTOCOL_3_0;
> conn->c_laddr = laddr;
Thanks, will include in next rds updates!
Regards -- Andy
prev parent reply other threads:[~2009-04-09 17:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-09 8:02 rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset Wei Yongjun
2009-04-09 17:43 ` Andy Grover [this message]
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=49DE33B1.4010700@oracle.com \
--to=andy.grover@oracle.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=yjwei@cn.fujitsu.com \
/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).