From: Julia Lawall <julia@diku.dk>
To: ecashin@coraid.com, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH 1/7] drivers/block/aoe: Use kzalloc for allocating only one thing
Date: Sat, 19 Dec 2009 08:16:13 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.0912190815550.30546@ask.diku.dk> (raw)
From: Julia Lawall <julia@diku.dk>
Use kzalloc rather than kcalloc(1,...)
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
@@
- kcalloc(1,
+ kzalloc(
...)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/block/aoe/aoecmd.c | 2 +-
drivers/block/aoe/aoedev.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff -u -p a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
--- a/drivers/block/aoe/aoecmd.c 2009-12-08 20:58:27.000000000 +0100
+++ b/drivers/block/aoe/aoecmd.c 2009-12-19 07:52:28.000000000 +0100
@@ -954,7 +954,7 @@ addtgt(struct aoedev *d, char *addr, ulo
"aoe: device addtgt failure; too many targets\n");
return NULL;
}
- t = kcalloc(1, sizeof *t, GFP_ATOMIC);
+ t = kzalloc(sizeof *t, GFP_ATOMIC);
f = kcalloc(nframes, sizeof *f, GFP_ATOMIC);
if (!t || !f) {
kfree(f);
diff -u -p a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
--- a/drivers/block/aoe/aoedev.c 2009-09-14 14:55:49.000000000 +0200
+++ b/drivers/block/aoe/aoedev.c 2009-12-19 07:52:28.000000000 +0100
@@ -211,7 +211,7 @@ aoedev_by_sysminor_m(ulong sysminor)
break;
if (d)
goto out;
- d = kcalloc(1, sizeof *d, GFP_ATOMIC);
+ d = kzalloc(sizeof *d, GFP_ATOMIC);
if (!d)
goto out;
INIT_WORK(&d->work, aoecmd_sleepwork);
next reply other threads:[~2009-12-19 7:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-19 7:16 Julia Lawall [this message]
2009-12-19 18:22 ` Ed Cashin
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=Pine.LNX.4.64.0912190815550.30546@ask.diku.dk \
--to=julia@diku.dk \
--cc=ecashin@coraid.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®