ALSA: Use kzalloc for allocating only one thing
authorJulia Lawall <julia@diku.dk>
Sat, 19 Dec 2009 07:18:03 +0000 (08:18 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 19 Dec 2009 08:40:26 +0000 (09:40 +0100)
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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/isa/msnd/msnd_midi.c
sound/pci/hda/patch_realtek.c

index cb9aa4c4edd08ad895f1be5b688aa93bee6dedab..4be562b2cf219bd12402ddb7778fd50f4f684abe 100644 (file)
@@ -162,7 +162,7 @@ int snd_msndmidi_new(struct snd_card *card, int device)
        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;
index aeed4cc5aa797110cfdabbe340cb26909be4f781..20c1828e4bacbdee5c8663194001fb433fb1d106 100644 (file)
@@ -12857,7 +12857,7 @@ static int patch_alc268(struct hda_codec *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;