Skip to content

Commit ed38c33

Browse files
JuliaLawallamschuma-ntap
authored andcommitted
xprtrdma: drop double zeroing
sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(*x),flags) ... sg_init_table(x,n) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Acked-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent c754e13 commit ed38c33

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/sunrpc/xprtrdma/frwr_ops.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)
124124
if (IS_ERR(frmr))
125125
goto out_mr_err;
126126

127-
sg = kcalloc(depth, sizeof(*sg), GFP_NOFS);
127+
sg = kmalloc_array(depth, sizeof(*sg), GFP_NOFS);
128128
if (!sg)
129129
goto out_list_err;
130130

0 commit comments

Comments
 (0)