ALSA: hda - hide HDMI/ELD printks unless snd.debug=2

Also remove two warnings when CONFIG_SND_DEBUG is not set:

sound/pci/hda/patch_hdmi.c: In function ‘hdmi_intrinsic_event’:
sound/pci/hda/patch_hdmi.c:761:6: warning: unused variable ‘eldv’ [-Wunused-variable]
sound/pci/hda/patch_hdmi.c:760:6: warning: unused variable ‘pd’ [-Wunused-variable]

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Fengguang Wu 2012-04-10 17:00:35 +08:00 committed by Takashi Iwai
parent 38be95dd3d
commit fae3d88a5c
3 changed files with 17 additions and 8 deletions

View File

@ -325,6 +325,13 @@ void release_and_free_resource(struct resource *res);
/* --- */ /* --- */
/* sound printk debug levels */
enum {
SND_PR_ALWAYS,
SND_PR_DEBUG,
SND_PR_VERBOSE,
};
#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
__printf(4, 5) __printf(4, 5)
void __snd_printk(unsigned int level, const char *file, int line, void __snd_printk(unsigned int level, const char *file, int line,
@ -354,6 +361,8 @@ void __snd_printk(unsigned int level, const char *file, int line,
*/ */
#define snd_printd(fmt, args...) \ #define snd_printd(fmt, args...) \
__snd_printk(1, __FILE__, __LINE__, fmt, ##args) __snd_printk(1, __FILE__, __LINE__, fmt, ##args)
#define _snd_printd(level, fmt, args...) \
__snd_printk(level, __FILE__, __LINE__, fmt, ##args)
/** /**
* snd_BUG - give a BUG warning message and stack trace * snd_BUG - give a BUG warning message and stack trace
@ -383,6 +392,7 @@ void __snd_printk(unsigned int level, const char *file, int line,
#else /* !CONFIG_SND_DEBUG */ #else /* !CONFIG_SND_DEBUG */
#define snd_printd(fmt, args...) do { } while (0) #define snd_printd(fmt, args...) do { } while (0)
#define _snd_printd(level, fmt, args...) do { } while (0)
#define snd_BUG() do { } while (0) #define snd_BUG() do { } while (0)
static inline int __snd_bug_on(int cond) static inline int __snd_bug_on(int cond)
{ {

View File

@ -418,7 +418,7 @@ static void hdmi_show_short_audio_desc(struct cea_sad *a)
else else
buf2[0] = '\0'; buf2[0] = '\0';
printk(KERN_INFO "HDMI: supports coding type %s:" _snd_printd(SND_PR_VERBOSE, "HDMI: supports coding type %s:"
" channels = %d, rates =%s%s\n", " channels = %d, rates =%s%s\n",
cea_audio_coding_type_names[a->format], cea_audio_coding_type_names[a->format],
a->channels, a->channels,
@ -442,14 +442,14 @@ void snd_hdmi_show_eld(struct hdmi_eld *e)
{ {
int i; int i;
printk(KERN_INFO "HDMI: detected monitor %s at connection type %s\n", _snd_printd(SND_PR_VERBOSE, "HDMI: detected monitor %s at connection type %s\n",
e->monitor_name, e->monitor_name,
eld_connection_type_names[e->conn_type]); eld_connection_type_names[e->conn_type]);
if (e->spk_alloc) { if (e->spk_alloc) {
char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE]; char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf)); snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
printk(KERN_INFO "HDMI: available speakers:%s\n", buf); _snd_printd(SND_PR_VERBOSE, "HDMI: available speakers:%s\n", buf);
} }
for (i = 0; i < e->sad_count; i++) for (i = 0; i < e->sad_count; i++)

View File

@ -757,8 +757,6 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
struct hdmi_spec *spec = codec->spec; struct hdmi_spec *spec = codec->spec;
int tag = res >> AC_UNSOL_RES_TAG_SHIFT; int tag = res >> AC_UNSOL_RES_TAG_SHIFT;
int pin_nid; int pin_nid;
int pd = !!(res & AC_UNSOL_RES_PD);
int eldv = !!(res & AC_UNSOL_RES_ELDV);
int pin_idx; int pin_idx;
struct hda_jack_tbl *jack; struct hda_jack_tbl *jack;
@ -768,9 +766,10 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
pin_nid = jack->nid; pin_nid = jack->nid;
jack->jack_dirty = 1; jack->jack_dirty = 1;
printk(KERN_INFO _snd_printd(SND_PR_VERBOSE,
"HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", "HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
codec->addr, pin_nid, pd, eldv); codec->addr, pin_nid,
!!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV));
pin_idx = pin_nid_to_pin_index(spec, pin_nid); pin_idx = pin_nid_to_pin_index(spec, pin_nid);
if (pin_idx < 0) if (pin_idx < 0)
@ -992,7 +991,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
if (eld->monitor_present) if (eld->monitor_present)
eld_valid = !!(present & AC_PINSENSE_ELDV); eld_valid = !!(present & AC_PINSENSE_ELDV);
printk(KERN_INFO _snd_printd(SND_PR_VERBOSE,
"HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
codec->addr, pin_nid, eld->monitor_present, eld_valid); codec->addr, pin_nid, eld->monitor_present, eld_valid);