Commit ef86f581 authored by Julia Lawall's avatar Julia Lawall Committed by Takashi Iwai

ALSA: Use kzalloc for allocating only one thing

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d6a89fef
...@@ -162,7 +162,7 @@ int snd_msndmidi_new(struct snd_card *card, int device) ...@@ -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); err = snd_rawmidi_new(card, "MSND-MIDI", device, 1, 1, &rmidi);
if (err < 0) if (err < 0)
return err; return err;
mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL); mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
if (mpu == NULL) { if (mpu == NULL) {
snd_device_free(card, rmidi); snd_device_free(card, rmidi);
return -ENOMEM; return -ENOMEM;
......
...@@ -12857,7 +12857,7 @@ static int patch_alc268(struct hda_codec *codec) ...@@ -12857,7 +12857,7 @@ static int patch_alc268(struct hda_codec *codec)
int board_config; int board_config;
int i, has_beep, err; int i, has_beep, err;
spec = kcalloc(1, sizeof(*spec), GFP_KERNEL); spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment