ALSA: Make snd_printd() and snd_printdd() inline

Because currently snd_printd() and snd_printdd() macros are expanded
to empty when CONFIG_SND_DEBUG=n, a compile warning like below
appears sometimes, and we had to covert it by ugly ifdefs:
  sound/pci/hda/patch_sigmatel.c: In function ‘stac92hd71bxx_fixup_hp’:
  sound/pci/hda/patch_sigmatel.c:2434:24: warning: unused variable ‘spec’ [-Wunused-variable]

For "fixing" these issues better, this patch replaces snd_printd() and
snd_printdd() definitions with empty inline functions instead of
macros.  This should have the same effect but shut up warnings like
above.

But since we had already put ifdefs, changing to inline functions
would trigger compile errors.  So, such ifdefs is removed in this
patch.

In addition, snd_pci_quirk name field is defined only when
CONFIG_SND_DEBUG_VERBOSE is set, and the reference to it in
snd_printdd() argument triggers the build errors, too.  For avoiding
these errors, introduce a new macro snd_pci_quirk_name() that is
defined no matter how the debug option is set.

Reported-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2013-01-25 10:54:07 +01:00
parent f4f678d222
commit 86b2723725
11 changed files with 29 additions and 25 deletions

View File

@@ -3266,11 +3266,13 @@ static int check_default_spdif_aclink(struct pci_dev *pci)
w = snd_pci_quirk_lookup(pci, spdif_aclink_defaults);
if (w) {
if (w->value)
snd_printdd(KERN_INFO "intel8x0: Using SPDIF over "
"AC-Link for %s\n", w->name);
snd_printdd(KERN_INFO
"intel8x0: Using SPDIF over AC-Link for %s\n",
snd_pci_quirk_name(w));
else
snd_printdd(KERN_INFO "intel8x0: Using integrated "
"SPDIF DMA for %s\n", w->name);
snd_printdd(KERN_INFO
"intel8x0: Using integrated SPDIF DMA for %s\n",
snd_pci_quirk_name(w));
return w->value;
}
return 0;