From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: Andy Grover <andy.grover@oracle.com>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
Date: Thu, 09 Apr 2009 16:02:18 +0800 [thread overview]
Message-ID: <49DDAB8A.5000300@cn.fujitsu.com> (raw)
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;
--
1.5.3.8
next reply other threads:[~2009-04-09 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-09 8:02 Wei Yongjun [this message]
2009-04-09 17:43 ` rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset Andy Grover
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=49DDAB8A.5000300@cn.fujitsu.com \
--to=yjwei@cn.fujitsu.com \
--cc=andy.grover@oracle.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).