aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--include/sound/core.h12
-rw-r--r--sound/drivers/vx/vx_core.c3
-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
-rw-r--r--sound/usb/pcm.c2
11 files changed, 29 insertions, 25 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index 93896ad1fcdd..7cede2d6aa86 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -394,8 +394,11 @@ void __snd_printk(unsigned int level, const char *file, int line,
394 394
395#else /* !CONFIG_SND_DEBUG */ 395#else /* !CONFIG_SND_DEBUG */
396 396
397#define snd_printd(fmt, args...) do { } while (0) 397__printf(1, 2)
398#define _snd_printd(level, fmt, args...) do { } while (0) 398static inline void snd_printd(const char *format, ...) {}
399__printf(2, 3)
400static inline void _snd_printd(int level, const char *format, ...) {}
401
399#define snd_BUG() do { } while (0) 402#define snd_BUG() do { } while (0)
400static inline int __snd_bug_on(int cond) 403static inline int __snd_bug_on(int cond)
401{ 404{
@@ -416,7 +419,8 @@ static inline int __snd_bug_on(int cond)
416#define snd_printdd(format, args...) \ 419#define snd_printdd(format, args...) \
417 __snd_printk(2, __FILE__, __LINE__, format, ##args) 420 __snd_printk(2, __FILE__, __LINE__, format, ##args)
418#else 421#else
419#define snd_printdd(format, args...) do { } while (0) 422__printf(1, 2)
423static inline void snd_printdd(const char *format, ...) {}
420#endif 424#endif
421 425
422 426
@@ -454,6 +458,7 @@ struct snd_pci_quirk {
454#define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \ 458#define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \
455 {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), \ 459 {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), \
456 .value = (val), .name = (xname)} 460 .value = (val), .name = (xname)}
461#define snd_pci_quirk_name(q) ((q)->name)
457#else 462#else
458#define SND_PCI_QUIRK(vend,dev,xname,val) \ 463#define SND_PCI_QUIRK(vend,dev,xname,val) \
459 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)} 464 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)}
@@ -461,6 +466,7 @@ struct snd_pci_quirk {
461 {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)} 466 {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)}
462#define SND_PCI_QUIRK_VENDOR(vend, xname, val) \ 467#define SND_PCI_QUIRK_VENDOR(vend, xname, val) \
463 {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)} 468 {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)}
469#define snd_pci_quirk_name(q) ""
464#endif 470#endif
465 471
466const struct snd_pci_quirk * 472const struct snd_pci_quirk *
diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c
index de5055a3b0d0..c39961c11401 100644
--- a/sound/drivers/vx/vx_core.c
+++ b/sound/drivers/vx/vx_core.c
@@ -52,7 +52,6 @@ MODULE_LICENSE("GPL");
52int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time) 52int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time)
53{ 53{
54 unsigned long end_time = jiffies + (time * HZ + 999) / 1000; 54 unsigned long end_time = jiffies + (time * HZ + 999) / 1000;
55#ifdef CONFIG_SND_DEBUG
56 static char *reg_names[VX_REG_MAX] = { 55 static char *reg_names[VX_REG_MAX] = {
57 "ICR", "CVR", "ISR", "IVR", "RXH", "RXM", "RXL", 56 "ICR", "CVR", "ISR", "IVR", "RXH", "RXM", "RXL",
58 "DMA", "CDSP", "RFREQ", "RUER/V2", "DATA", "MEMIRQ", 57 "DMA", "CDSP", "RFREQ", "RUER/V2", "DATA", "MEMIRQ",
@@ -60,7 +59,7 @@ int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int t
60 "MIC3", "INTCSR", "CNTRL", "GPIOC", 59 "MIC3", "INTCSR", "CNTRL", "GPIOC",
61 "LOFREQ", "HIFREQ", "CSUER", "RUER" 60 "LOFREQ", "HIFREQ", "CSUER", "RUER"
62 }; 61 };
63#endif 62
64 do { 63 do {
65 if ((snd_vx_inb(chip, reg) & mask) == bit) 64 if ((snd_vx_inb(chip, reg) & mask) == bit)
66 return 0; 65 return 0;
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
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index b839b60f9858..81f70a719bb9 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -1179,9 +1179,7 @@ static void retire_capture_urb(struct snd_usb_substream *subs,
1179 if (!subs->txfr_quirk) 1179 if (!subs->txfr_quirk)
1180 bytes = frames * stride; 1180 bytes = frames * stride;
1181 if (bytes % (runtime->sample_bits >> 3) != 0) { 1181 if (bytes % (runtime->sample_bits >> 3) != 0) {
1182#ifdef CONFIG_SND_DEBUG_VERBOSE
1183 int oldbytes = bytes; 1182 int oldbytes = bytes;
1184#endif
1185 bytes = frames * stride; 1183 bytes = frames * stride;
1186 snd_printdd(KERN_ERR "Corrected urb data len. %d->%d\n", 1184 snd_printdd(KERN_ERR "Corrected urb data len. %d->%d\n",
1187 oldbytes, bytes); 1185 oldbytes, bytes);