Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Julia Lawall <Julia.Lawall@inria.fr>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: kernel-janitors@vger.kernel.org,
Chuck Lever <chuck.lever@oracle.com>,
Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 08/14] xprtrdma: drop double zeroing
Date: Sun, 20 Sep 2020 13:26:20 +0200 [thread overview]
Message-ID: <1600601186-7420-9-git-send-email-Julia.Lawall@inria.fr> (raw)
In-Reply-To: <1600601186-7420-1-git-send-email-Julia.Lawall@inria.fr>
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>
---
net/sunrpc/xprtrdma/frwr_ops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -u -p a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -124,7 +124,7 @@ int frwr_mr_init(struct rpcrdma_xprt *r_
if (IS_ERR(frmr))
goto out_mr_err;
- sg = kcalloc(depth, sizeof(*sg), GFP_NOFS);
+ sg = kmalloc_array(depth, sizeof(*sg), GFP_NOFS);
if (!sg)
goto out_list_err;
next prev parent reply other threads:[~2020-09-20 12:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-20 11:26 [PATCH 00/14] " Julia Lawall
2020-09-20 11:26 ` [PATCH 03/14] dpaa2-eth: " Julia Lawall
2020-09-21 2:09 ` David Miller
2020-09-20 11:26 ` [PATCH 07/14] RDS: " Julia Lawall
2020-09-21 2:09 ` David Miller
2020-09-20 11:26 ` Julia Lawall [this message]
2020-09-20 15:37 ` [PATCH 08/14] xprtrdma: " Chuck Lever
2020-09-20 11:26 ` [PATCH 10/14] iwlwifi: dbg_ini: " Julia Lawall
2020-09-21 16:58 ` [PATCH 00/14] " Mark Brown
2020-09-23 15:10 ` Rolf Reintjes
2020-09-23 15:16 ` Mark Brown
2020-10-13 22:42 ` Martin K. Petersen
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=1600601186-7420-9-git-send-email-Julia.Lawall@inria.fr \
--to=julia.lawall@inria.fr \
--cc=anna.schumaker@netapp.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
--subject='Re: [PATCH 08/14] xprtrdma: drop double zeroing' \
/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
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).