netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Grover <andy.grover@oracle.com>
To: netdev@vger.kernel.org
Cc: rds-devel@oss.oracle.com, Wei Yongjun <yjwei@cn.fujitsu.com>
Subject: [PATCH 09/12] rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
Date: Thu,  9 Apr 2009 17:09:44 -0700	[thread overview]
Message-ID: <1239322187-3764-10-git-send-email-andy.grover@oracle.com> (raw)
In-Reply-To: <1239322187-3764-1-git-send-email-andy.grover@oracle.com>

From: Wei Yongjun <yjwei@cn.fujitsu.com>

Use kmem_cache_zalloc instead of kmem_cache_alloc/memset.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Andy Grover <andy.grover@oracle.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.6.3


  parent reply	other threads:[~2009-04-10  0:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
2009-04-10  0:09 ` [PATCH 01/12] RDS/IW+IB: Set recv ring low water mark to 1/2 full Andy Grover
2009-04-10  0:09 ` [PATCH 02/12] RDS: Correct some iw references in rdma_transport.c Andy Grover
2009-04-10  0:09 ` [PATCH 03/12] RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled Andy Grover
2009-04-10  0:09 ` [PATCH 04/12] RDS/IW+IB: Allow max credit advertise window Andy Grover
2009-04-10  0:09 ` [PATCH 05/12] RDS: Fix ordering in a conditional Andy Grover
2009-04-10  0:09 ` [PATCH 06/12] RDS: Establish connection before parsing CMSGs Andy Grover
2009-04-10  0:09 ` [PATCH 07/12] RDS: use get_user_pages_fast() Andy Grover
2009-04-10  0:09 ` [PATCH 08/12] RDS: remove unused #include <version.h> Andy Grover
2009-04-10  0:09 ` Andy Grover [this message]
2009-04-10  0:09 ` [PATCH 10/12] ERR_PTR() dereference in net/rds/iw.c Andy Grover
2009-04-10  0:09 ` [PATCH 11/12] ERR_PTR() dereference in net/rds/ib.c Andy Grover
2009-04-10  0:09 ` [PATCH 12/12] MAINTAINERS: rds list is moderated Andy Grover
2009-04-10  0:21 ` [PATCH net-next 0/12] RDS: updates for net-next David Miller

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=1239322187-3764-10-git-send-email-andy.grover@oracle.com \
    --to=andy.grover@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --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).