* [PATCH 1/7] drivers/block/aoe: Use kzalloc for allocating only one thing
@ 2009-12-19 7:16 Julia Lawall
2009-12-19 18:22 ` Ed Cashin
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2009-12-19 7:16 UTC (permalink / raw)
To: ecashin, linux-kernel, kernel-janitors
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/7] drivers/block/aoe: Use kzalloc for allocating only one thing
2009-12-19 7:16 [PATCH 1/7] drivers/block/aoe: Use kzalloc for allocating only one thing Julia Lawall
@ 2009-12-19 18:22 ` Ed Cashin
0 siblings, 0 replies; 2+ messages in thread
From: Ed Cashin @ 2009-12-19 18:22 UTC (permalink / raw)
To: Julia Lawall; +Cc: linux-kernel, kernel-janitors
On Sat, Dec 19, 2009 at 08:16:13AM +0100, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> Use kzalloc rather than kcalloc(1,...)
I suppose so. The calloc function has always been silly, but
everybody knows that, so I don't really think this patch helps
anything. I guess somebody disagrees with me.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-19 18:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-19 7:16 [PATCH 1/7] drivers/block/aoe: Use kzalloc for allocating only one thing Julia Lawall
2009-12-19 18:22 ` Ed Cashin
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®