diff options
author | Julia Lawall <julia@diku.dk> | 2010-05-13 15:58:37 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-05-17 02:12:44 -0400 |
commit | 550a8b691ca67761bbf382d98fbd81d215f1d7f0 (patch) | |
tree | ffa575dee79ce5ae6ce8a358b9599d2cb309aef8 /sound/pci/asihpi/hpi6205.c | |
parent | 1be1d76b8a1f622fd3a64778dfe117053f2af1f2 (diff) |
ALSA: sound/pci/asihpi: Use kzalloc
Use kzalloc rather than the combination of kmalloc and memset.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x,size,flags;
statement S;
@@
-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
if (x == NULL) S
-memset(x, 0, size);
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi/hpi6205.c')
-rw-r--r-- | sound/pci/asihpi/hpi6205.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c index 8df2ff76d944..5e88c1fc2b9e 100644 --- a/sound/pci/asihpi/hpi6205.c +++ b/sound/pci/asihpi/hpi6205.c | |||
@@ -482,13 +482,12 @@ static void subsys_create_adapter(struct hpi_message *phm, | |||
482 | if (phm->u.s.resource.r.pci->device_id != HPI_PCI_DEV_ID_DSP6205) | 482 | if (phm->u.s.resource.r.pci->device_id != HPI_PCI_DEV_ID_DSP6205) |
483 | return; | 483 | return; |
484 | 484 | ||
485 | ao.priv = kmalloc(sizeof(struct hpi_hw_obj), GFP_KERNEL); | 485 | ao.priv = kzalloc(sizeof(struct hpi_hw_obj), GFP_KERNEL); |
486 | if (!ao.priv) { | 486 | if (!ao.priv) { |
487 | HPI_DEBUG_LOG(ERROR, "cant get mem for adapter object\n"); | 487 | HPI_DEBUG_LOG(ERROR, "cant get mem for adapter object\n"); |
488 | phr->error = HPI_ERROR_MEMORY_ALLOC; | 488 | phr->error = HPI_ERROR_MEMORY_ALLOC; |
489 | return; | 489 | return; |
490 | } | 490 | } |
491 | memset(ao.priv, 0, sizeof(struct hpi_hw_obj)); | ||
492 | 491 | ||
493 | ao.pci = *phm->u.s.resource.r.pci; | 492 | ao.pci = *phm->u.s.resource.r.pci; |
494 | err = create_adapter_obj(&ao, &os_error_code); | 493 | err = create_adapter_obj(&ao, &os_error_code); |