* [PATCH 7/7] sound: Use kzalloc for allocating only one thing
@ 2009-12-19 7:18 Julia Lawall
2009-12-19 8:40 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2009-12-19 7:18 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, linux-kernel, alsa-devel, 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>
---
sound/isa/msnd/msnd_midi.c | 2 +-
sound/pci/hda/patch_realtek.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff -u -p a/sound/isa/msnd/msnd_midi.c b/sound/isa/msnd/msnd_midi.c
--- a/sound/isa/msnd/msnd_midi.c 2009-03-28 23:34:55.000000000 +0100
+++ b/sound/isa/msnd/msnd_midi.c 2009-12-19 07:52:27.000000000 +0100
@@ -162,7 +162,7 @@ int snd_msndmidi_new(struct snd_card *ca
err = snd_rawmidi_new(card, "MSND-MIDI", device, 1, 1, &rmidi);
if (err < 0)
return err;
- mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL);
+ mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
if (mpu == NULL) {
snd_device_free(card, rmidi);
return -ENOMEM;
diff -u -p a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
--- a/sound/pci/hda/patch_realtek.c 2009-12-17 08:30:15.000000000 +0100
+++ b/sound/pci/hda/patch_realtek.c 2009-12-19 07:52:50.000000000 +0100
@@ -12857,7 +12857,7 @@ static int patch_alc268(struct hda_codec
int board_config;
int i, has_beep, err;
- spec = kcalloc(1, sizeof(*spec), GFP_KERNEL);
+ spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL)
return -ENOMEM;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 7/7] sound: Use kzalloc for allocating only one thing
2009-12-19 7:18 [PATCH 7/7] sound: Use kzalloc for allocating only one thing Julia Lawall
@ 2009-12-19 8:40 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2009-12-19 8:40 UTC (permalink / raw)
To: Julia Lawall; +Cc: Jaroslav Kysela, linux-kernel, alsa-devel, kernel-janitors
At Sat, 19 Dec 2009 08:18:03 +0100 (CET),
Julia Lawall wrote:
>
> 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>
Applied now. Thanks.
Takashi
>
> ---
> sound/isa/msnd/msnd_midi.c | 2 +-
> sound/pci/hda/patch_realtek.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff -u -p a/sound/isa/msnd/msnd_midi.c b/sound/isa/msnd/msnd_midi.c
> --- a/sound/isa/msnd/msnd_midi.c 2009-03-28 23:34:55.000000000 +0100
> +++ b/sound/isa/msnd/msnd_midi.c 2009-12-19 07:52:27.000000000 +0100
> @@ -162,7 +162,7 @@ int snd_msndmidi_new(struct snd_card *ca
> err = snd_rawmidi_new(card, "MSND-MIDI", device, 1, 1, &rmidi);
> if (err < 0)
> return err;
> - mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL);
> + mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
> if (mpu == NULL) {
> snd_device_free(card, rmidi);
> return -ENOMEM;
> diff -u -p a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> --- a/sound/pci/hda/patch_realtek.c 2009-12-17 08:30:15.000000000 +0100
> +++ b/sound/pci/hda/patch_realtek.c 2009-12-19 07:52:50.000000000 +0100
> @@ -12857,7 +12857,7 @@ static int patch_alc268(struct hda_codec
> int board_config;
> int i, has_beep, err;
>
> - spec = kcalloc(1, sizeof(*spec), GFP_KERNEL);
> + spec = kzalloc(sizeof(*spec), GFP_KERNEL);
> if (spec == NULL)
> return -ENOMEM;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-19 8:40 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:18 [PATCH 7/7] sound: Use kzalloc for allocating only one thing Julia Lawall
2009-12-19 8:40 ` Takashi Iwai
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®