Skip to content

Commit 561b220

Browse files
tiwaiJaroslav Kysela
authored andcommitted
[ALSA] Replace with kzalloc() - others
Documentation,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,OPL3 OPL4,Digigram VX core,I2C cs8427,I2C lib core,I2C tea6330t,L3 drivers AK4114 receiver,AK4117 receiver,PDAudioCF driver,PPC PMAC driver SPARC AMD7930 driver,SPARC cs4231 driver,Synth,Common EMU synth USB generic driver,USB USX2Y Replace kcalloc(1,..) with kzalloc(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent e560d8d commit 561b220

29 files changed

Lines changed: 48 additions & 48 deletions

‎Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
....
448448

449449
/* allocate a chip-specific data with zero filled */
450-
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
450+
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
451451
if (chip == NULL)
452452
return -ENOMEM;
453453

@@ -949,7 +949,7 @@
949949
After allocating a card instance via
950950
<function>snd_card_new()</function> (with
951951
<constant>NULL</constant> on the 4th arg), call
952-
<function>kcalloc()</function>.
952+
<function>kzalloc()</function>.
953953

954954
<informalexample>
955955
<programlisting>
@@ -958,7 +958,7 @@
958958
mychip_t *chip;
959959
card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
960960
.....
961-
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
961+
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
962962
]]>
963963
</programlisting>
964964
</informalexample>
@@ -1136,7 +1136,7 @@
11361136
return -ENXIO;
11371137
}
11381138

1139-
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
1139+
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
11401140
if (chip == NULL) {
11411141
pci_disable_device(pci);
11421142
return -ENOMEM;
@@ -1292,7 +1292,7 @@
12921292
need to initialize this number as -1 before actual allocation,
12931293
since irq 0 is valid. The port address and its resource pointer
12941294
can be initialized as null by
1295-
<function>kcalloc()</function> automatically, so you
1295+
<function>kzalloc()</function> automatically, so you
12961296
don't have to take care of resetting them.
12971297
</para>
12981298

‎sound/arm/sa11xx-uda1341.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* merged HAL layer (patches from Brian)
2222
*/
2323

24-
/* $Id: sa11xx-uda1341.c,v 1.22 2005/09/05 16:17:58 tiwai Exp $ */
24+
/* $Id: sa11xx-uda1341.c,v 1.23 2005/09/09 13:22:34 tiwai Exp $ */
2525

2626
/***************************************************************************************************
2727
*
@@ -918,7 +918,7 @@ static int __init sa11xx_uda1341_init(void)
918918
if (card == NULL)
919919
return -ENOMEM;
920920

921-
sa11xx_uda1341 = kcalloc(1, sizeof(*sa11xx_uda1341), GFP_KERNEL);
921+
sa11xx_uda1341 = kzalloc(sizeof(*sa11xx_uda1341), GFP_KERNEL);
922922
if (sa11xx_uda1341 == NULL)
923923
return -ENOMEM;
924924
spin_lock_init(&chip->s[0].dma_lock);

‎sound/drivers/dummy.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream)
337337
snd_card_dummy_pcm_t *dpcm;
338338
int err;
339339

340-
dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL);
340+
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
341341
if (dpcm == NULL)
342342
return -ENOMEM;
343343
init_timer(&dpcm->timer);
@@ -368,7 +368,7 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream)
368368
snd_card_dummy_pcm_t *dpcm;
369369
int err;
370370

371-
dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL);
371+
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
372372
if (dpcm == NULL)
373373
return -ENOMEM;
374374
init_timer(&dpcm->timer);

‎sound/drivers/mpu401/mpu401_uart.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ int snd_mpu401_uart_new(snd_card_t * card, int device,
463463
*rrawmidi = NULL;
464464
if ((err = snd_rawmidi_new(card, "MPU-401U", device, 1, 1, &rmidi)) < 0)
465465
return err;
466-
mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL);
466+
mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
467467
if (mpu == NULL) {
468468
snd_device_free(card, rmidi);
469469
return -ENOMEM;

‎sound/drivers/mtpav.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard)
688688

689689
static mtpav_t *new_mtpav(void)
690690
{
691-
mtpav_t *ncrd = kcalloc(1, sizeof(*ncrd), GFP_KERNEL);
691+
mtpav_t *ncrd = kzalloc(sizeof(*ncrd), GFP_KERNEL);
692692
if (ncrd != NULL) {
693693
spin_lock_init(&ncrd->spinlock);
694694

‎sound/drivers/opl3/opl3_lib.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ int snd_opl3_new(snd_card_t *card,
354354
int err;
355355

356356
*ropl3 = NULL;
357-
opl3 = kcalloc(1, sizeof(*opl3), GFP_KERNEL);
357+
opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL);
358358
if (opl3 == NULL)
359359
return -ENOMEM;
360360

‎sound/drivers/opl3/opl3_oss.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
241241
}
242242

243243
size = sizeof(*put) + sizeof(fm_xinstrument_t);
244-
put = kcalloc(1, size, GFP_KERNEL);
244+
put = kzalloc(size, GFP_KERNEL);
245245
if (put == NULL)
246246
return -ENOMEM;
247247
/* build header */

‎sound/drivers/opl4/opl4_lib.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ int snd_opl4_create(snd_card_t *card,
204204
if (ropl4)
205205
*ropl4 = NULL;
206206

207-
opl4 = kcalloc(1, sizeof(*opl4), GFP_KERNEL);
207+
opl4 = kzalloc(sizeof(*opl4), GFP_KERNEL);
208208
if (!opl4)
209209
return -ENOMEM;
210210

‎sound/drivers/serial-u16550.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ static int __init snd_uart16550_create(snd_card_t * card,
779779
int err;
780780

781781

782-
if ((uart = kcalloc(1, sizeof(*uart), GFP_KERNEL)) == NULL)
782+
if ((uart = kzalloc(sizeof(*uart), GFP_KERNEL)) == NULL)
783783
return -ENOMEM;
784784
uart->adaptor = adaptor;
785785
uart->card = card;

‎sound/drivers/vx/vx_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw,
782782

783783
snd_assert(card && hw && ops, return NULL);
784784

785-
chip = kcalloc(1, sizeof(*chip) + extra_size, GFP_KERNEL);
785+
chip = kzalloc(sizeof(*chip) + extra_size, GFP_KERNEL);
786786
if (! chip) {
787787
snd_printk(KERN_ERR "vx_core: no memory\n");
788788
return NULL;

0 commit comments

Comments
 (0)