aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/asihpi/hpi6000.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-05-13 15:58:37 -0400
committerTakashi Iwai <tiwai@suse.de>2010-05-17 02:12:44 -0400
commit550a8b691ca67761bbf382d98fbd81d215f1d7f0 (patch)
treeffa575dee79ce5ae6ce8a358b9599d2cb309aef8 /sound/pci/asihpi/hpi6000.c
parent1be1d76b8a1f622fd3a64778dfe117053f2af1f2 (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/hpi6000.c')
-rw-r--r--sound/pci/asihpi/hpi6000.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/pci/asihpi/hpi6000.c b/sound/pci/asihpi/hpi6000.c
index 9c50931731a5..839ecb2e4b64 100644
--- a/sound/pci/asihpi/hpi6000.c
+++ b/sound/pci/asihpi/hpi6000.c
@@ -448,14 +448,13 @@ static void subsys_create_adapter(struct hpi_message *phm,
448 if (phm->u.s.resource.r.pci->device_id != HPI_PCI_DEV_ID_PCI2040) 448 if (phm->u.s.resource.r.pci->device_id != HPI_PCI_DEV_ID_PCI2040)
449 return; 449 return;
450 450
451 ao.priv = kmalloc(sizeof(struct hpi_hw_obj), GFP_KERNEL); 451 ao.priv = kzalloc(sizeof(struct hpi_hw_obj), GFP_KERNEL);
452 if (!ao.priv) { 452 if (!ao.priv) {
453 HPI_DEBUG_LOG(ERROR, "cant get mem for adapter object\n"); 453 HPI_DEBUG_LOG(ERROR, "cant get mem for adapter object\n");
454 phr->error = HPI_ERROR_MEMORY_ALLOC; 454 phr->error = HPI_ERROR_MEMORY_ALLOC;
455 return; 455 return;
456 } 456 }
457 457
458 memset(ao.priv, 0, sizeof(struct hpi_hw_obj));
459 /* create the adapter object based on the resource information */ 458 /* create the adapter object based on the resource information */
460 /*? memcpy(&ao.Pci,&phm->u.s.Resource.r.Pci,sizeof(ao.Pci)); */ 459 /*? memcpy(&ao.Pci,&phm->u.s.Resource.r.Pci,sizeof(ao.Pci)); */
461 ao.pci = *phm->u.s.resource.r.pci; 460 ao.pci = *phm->u.s.resource.r.pci;