aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-25 04:54:07 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-25 12:32:14 -0500
commit86b2723725a2e186f5699d97cb20014fa893931f (patch)
tree844f9f196c14bf3f361e85ec28b5ad60e334dcc0 /sound/pci
parentf4f678d22219f5821f46bb78eb4da7f76f1899bc (diff)
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>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/atiixp.c5
-rw-r--r--sound/pci/hda/hda_auto_parser.c2
-rw-r--r--sound/pci/hda/hda_generic.c2
-rw-r--r--sound/pci/intel8x0.c10
-rw-r--r--sound/pci/maestro3.c10
-rw-r--r--sound/pci/nm256/nm256.c3
-rw-r--r--sound/pci/pcxhr/pcxhr_core.c3
-rw-r--r--sound/pci/via82xx.c2
8 files changed, 19 insertions, 18 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index a67743183aaf..6e78c6789858 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -567,8 +567,9 @@ static int ac97_probing_bugs(struct pci_dev *pci)
567 567
568 q = snd_pci_quirk_lookup(pci, atiixp_quirks); 568 q = snd_pci_quirk_lookup(pci, atiixp_quirks);
569 if (q) { 569 if (q) {
570 snd_printdd(KERN_INFO "Atiixp quirk for %s. " 570 snd_printdd(KERN_INFO
571 "Forcing codec %d\n", q->name, q->value); 571 "Atiixp quirk for %s. Forcing codec %d\n",
572 snd_pci_quirk_name(q), q->value);
572 return q->value; 573 return q->value;
573 } 574 }
574 /* this hardware doesn't need workarounds. Probe for codec */ 575 /* this hardware doesn't need workarounds. Probe for codec */
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 96a05c4c28e1..a3ea76a4c9d2 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -698,9 +698,7 @@ static void set_pin_targets(struct hda_codec *codec,
698 698
699static void apply_fixup(struct hda_codec *codec, int id, int action, int depth) 699static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
700{ 700{
701#ifdef CONFIG_SND_DEBUG_VERBOSE
702 const char *modelname = codec->fixup_name; 701 const char *modelname = codec->fixup_name;
703#endif
704 702
705 while (id >= 0) { 703 while (id >= 0) {
706 const struct hda_fixup *fix = codec->fixup_list + id; 704 const struct hda_fixup *fix = codec->fixup_list + id;
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 19d014a6a40e..c4ba3066a013 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -1579,9 +1579,7 @@ static void debug_show_configs(struct hda_codec *codec,
1579 struct auto_pin_cfg *cfg) 1579 struct auto_pin_cfg *cfg)
1580{ 1580{
1581 struct hda_gen_spec *spec = codec->spec; 1581 struct hda_gen_spec *spec = codec->spec;
1582#ifdef CONFIG_SND_DEBUG_VERBOSE
1583 static const char * const lo_type[3] = { "LO", "SP", "HP" }; 1582 static const char * const lo_type[3] = { "LO", "SP", "HP" };
1584#endif
1585 int i; 1583 int i;
1586 1584
1587 debug_badness("multi_outs = %x/%x/%x/%x : %x/%x/%x/%x (type %s)\n", 1585 debug_badness("multi_outs = %x/%x/%x/%x : %x/%x/%x/%x (type %s)\n",
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 3b9be752f3e2..b8fe40531b9c 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -3266,11 +3266,13 @@ static int check_default_spdif_aclink(struct pci_dev *pci)
3266 w = snd_pci_quirk_lookup(pci, spdif_aclink_defaults); 3266 w = snd_pci_quirk_lookup(pci, spdif_aclink_defaults);
3267 if (w) { 3267 if (w) {
3268 if (w->value) 3268 if (w->value)
3269 snd_printdd(KERN_INFO "intel8x0: Using SPDIF over " 3269 snd_printdd(KERN_INFO
3270 "AC-Link for %s\n", w->name); 3270 "intel8x0: Using SPDIF over AC-Link for %s\n",
3271 snd_pci_quirk_name(w));
3271 else 3272 else
3272 snd_printdd(KERN_INFO "intel8x0: Using integrated " 3273 snd_printdd(KERN_INFO
3273 "SPDIF DMA for %s\n", w->name); 3274 "intel8x0: Using integrated SPDIF DMA for %s\n",
3275 snd_pci_quirk_name(w));
3274 return w->value; 3276 return w->value;
3275 } 3277 }
3276 return 0; 3278 return 0;
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 9387533f70dc..c76ac1411210 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2586,8 +2586,9 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
2586 else { 2586 else {
2587 quirk = snd_pci_quirk_lookup(pci, m3_amp_quirk_list); 2587 quirk = snd_pci_quirk_lookup(pci, m3_amp_quirk_list);
2588 if (quirk) { 2588 if (quirk) {
2589 snd_printdd(KERN_INFO "maestro3: set amp-gpio " 2589 snd_printdd(KERN_INFO
2590 "for '%s'\n", quirk->name); 2590 "maestro3: set amp-gpio for '%s'\n",
2591 snd_pci_quirk_name(quirk));
2591 chip->amp_gpio = quirk->value; 2592 chip->amp_gpio = quirk->value;
2592 } else if (chip->allegro_flag) 2593 } else if (chip->allegro_flag)
2593 chip->amp_gpio = GPO_EXT_AMP_ALLEGRO; 2594 chip->amp_gpio = GPO_EXT_AMP_ALLEGRO;
@@ -2597,8 +2598,9 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
2597 2598
2598 quirk = snd_pci_quirk_lookup(pci, m3_irda_quirk_list); 2599 quirk = snd_pci_quirk_lookup(pci, m3_irda_quirk_list);
2599 if (quirk) { 2600 if (quirk) {
2600 snd_printdd(KERN_INFO "maestro3: enabled irda workaround " 2601 snd_printdd(KERN_INFO
2601 "for '%s'\n", quirk->name); 2602 "maestro3: enabled irda workaround for '%s'\n",
2603 snd_pci_quirk_name(quirk));
2602 chip->irda_workaround = 1; 2604 chip->irda_workaround = 1;
2603 } 2605 }
2604 quirk = snd_pci_quirk_lookup(pci, m3_hv_quirk_list); 2606 quirk = snd_pci_quirk_lookup(pci, m3_hv_quirk_list);
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 563a193e36a3..6febedb05936 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1660,7 +1660,8 @@ static int snd_nm256_probe(struct pci_dev *pci,
1660 1660
1661 q = snd_pci_quirk_lookup(pci, nm256_quirks); 1661 q = snd_pci_quirk_lookup(pci, nm256_quirks);
1662 if (q) { 1662 if (q) {
1663 snd_printdd(KERN_INFO "nm256: Enabled quirk for %s.\n", q->name); 1663 snd_printdd(KERN_INFO "nm256: Enabled quirk for %s.\n",
1664 snd_pci_quirk_name(q));
1664 switch (q->value) { 1665 switch (q->value) {
1665 case NM_BLACKLISTED: 1666 case NM_BLACKLISTED:
1666 printk(KERN_INFO "nm256: The device is blacklisted. " 1667 printk(KERN_INFO "nm256: The device is blacklisted. "
diff --git a/sound/pci/pcxhr/pcxhr_core.c b/sound/pci/pcxhr/pcxhr_core.c
index b33db1e006e7..37b431b9b69d 100644
--- a/sound/pci/pcxhr/pcxhr_core.c
+++ b/sound/pci/pcxhr/pcxhr_core.c
@@ -1012,13 +1012,12 @@ static int pcxhr_handle_async_err(struct pcxhr_mgr *mgr, u32 err,
1012 enum pcxhr_async_err_src err_src, int pipe, 1012 enum pcxhr_async_err_src err_src, int pipe,
1013 int is_capture) 1013 int is_capture)
1014{ 1014{
1015#ifdef CONFIG_SND_DEBUG_VERBOSE
1016 static char* err_src_name[] = { 1015 static char* err_src_name[] = {
1017 [PCXHR_ERR_PIPE] = "Pipe", 1016 [PCXHR_ERR_PIPE] = "Pipe",
1018 [PCXHR_ERR_STREAM] = "Stream", 1017 [PCXHR_ERR_STREAM] = "Stream",
1019 [PCXHR_ERR_AUDIO] = "Audio" 1018 [PCXHR_ERR_AUDIO] = "Audio"
1020 }; 1019 };
1021#endif 1020
1022 if (err & 0xfff) 1021 if (err & 0xfff)
1023 err &= 0xfff; 1022 err &= 0xfff;
1024 else 1023 else
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 6442f611a07b..d756a3562706 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -2517,7 +2517,7 @@ static int check_dxs_list(struct pci_dev *pci, int revision)
2517 w = snd_pci_quirk_lookup(pci, dxs_whitelist); 2517 w = snd_pci_quirk_lookup(pci, dxs_whitelist);
2518 if (w) { 2518 if (w) {
2519 snd_printdd(KERN_INFO "via82xx: DXS white list for %s found\n", 2519 snd_printdd(KERN_INFO "via82xx: DXS white list for %s found\n",
2520 w->name); 2520 snd_pci_quirk_name(w));
2521 return w->value; 2521 return w->value;
2522 } 2522 }
2523 2523