From 3733e424c4fcd8edff2090f0628f4fd245daddb5 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 10 Jun 2011 16:20:20 +0200 Subject: ALSA: Use KBUILD_MODNAME for pci_driver.name entries The convention for pci_driver.name entry in kernel drivers seem to be the module name or equivalent ones. But, so far, almost all PCI sound drivers use more verbose name like "ABC Xyz (12)", and these are fairly confusing when appearing as a file name. This patch converts the all pci_driver.name entries in sound/pci/* to use KBUILD_MODNAME for more unified appearance. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/pci/hda') diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 486f6deb3eee..29f1d36d6cb0 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2908,7 +2908,7 @@ MODULE_DEVICE_TABLE(pci, azx_ids); /* pci_driver definition */ static struct pci_driver driver = { - .name = "HDA Intel", + .name = KBUILD_MODNAME, .id_table = azx_ids, .probe = azx_probe, .remove = __devexit_p(azx_remove), -- cgit From 934c2b6d0cb50f9014ba0f10241e062a3bfc462d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 10 Jun 2011 16:36:37 +0200 Subject: ALSA: use KBUILD_MODNAME for request_irq argument in sound/pci/* The name argument of request_irq() appears in /proc/interrupts, and it's quite ugly when the name entry contains a space or special letters. In general, it's simpler and more readable when the module name appears there, so let's replace all entries with KBUILD_MODNAME. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/pci/hda') diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 29f1d36d6cb0..5cc3d07f715f 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2149,7 +2149,7 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect) { if (request_irq(chip->pci->irq, azx_interrupt, chip->msi ? 0 : IRQF_SHARED, - "hda_intel", chip)) { + KBUILD_MODNAME, chip)) { printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " "disabling device\n", chip->pci->irq); if (do_disconnect) -- cgit From 3101ba035ca9ba92f6cec7fd37348646b7a5cb61 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 12 Jul 2011 08:05:16 +0200 Subject: ALSA: Use krealloc() in possible places Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sound/pci/hda') diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 45b4a8d70e08..4afc6fcf0cd4 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -4957,17 +4957,14 @@ void *snd_array_new(struct snd_array *array) { if (array->used >= array->alloced) { int num = array->alloced + array->alloc_align; + int size = (num + 1) * array->elem_size; void *nlist; if (snd_BUG_ON(num >= 4096)) return NULL; - nlist = kcalloc(num + 1, array->elem_size, GFP_KERNEL); + nlist = krealloc(array->list, size, GFP_KERNEL); if (!nlist) return NULL; - if (array->list) { - memcpy(nlist, array->list, - array->elem_size * array->alloced); - kfree(array->list); - } + memset(nlist, 0, size - array->alloced * array->elem_size); array->list = nlist; array->alloced = num; } -- cgit From 00ef9610acf2a90b3e75096355b92ff34e7c8f74 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 14 Jul 2011 15:57:27 +0200 Subject: ALSA: hda - Fix krealloc() replacement in hda_codec.c It was obviously wrong, grr.... Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound/pci/hda') diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 4afc6fcf0cd4..f26e487eca1c 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -4958,13 +4958,14 @@ void *snd_array_new(struct snd_array *array) if (array->used >= array->alloced) { int num = array->alloced + array->alloc_align; int size = (num + 1) * array->elem_size; + int oldsize = array->alloced * array->elem_size; void *nlist; if (snd_BUG_ON(num >= 4096)) return NULL; nlist = krealloc(array->list, size, GFP_KERNEL); if (!nlist) return NULL; - memset(nlist, 0, size - array->alloced * array->elem_size); + memset(nlist + oldsize, 0, size - oldsize); array->list = nlist; array->alloced = num; } -- cgit