rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
authorWei Yongjun <yjwei@cn.fujitsu.com>
Thu, 9 Apr 2009 14:09:44 +0000 (14:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Apr 2009 00:21:21 +0000 (17:21 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/connection.c

index 273f064930a8e1aec7f8539ed54d928447e7a53a..d14445c48304cb3f4b7a946372186d8578a9b530 100644 (file)
@@ -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;