[alsa-devel] [PATCH] ALSA: get rid of CONFIG_SND_VERBOSE_PRINTK

Alan Stern stern at rowland.harvard.edu
Tue Jun 4 21:32:02 CEST 2013


On Tue, 4 Jun 2013, Takashi Iwai wrote:

> I wouldn't mind but some might do :)
> 
> So we should clean up the excessive usage of snd_printk() and convert
> them to the standard printk & co at first.

This part is now done (already posted).

The next step involves snd_printd() and snd_printdd().  Although these
are clearly intended to be used for debugging messages -- that's why
the names end in 'd' -- they nevertheless take a KERN_* level
indicator.

This doesn't make much sense.  Are these debugging messages or aren't 
they?  If they are, they should always use KERN_DEBUG.

As I see it, the best thing to do is replace snd_printd() with a
dev_dbg() wrapper and eliminate the level indicators.  This will
require changing all the Makefiles; they will need to have a line
saying

ccflags-$(CONFIG_SND_DEBUG) := -DDEBUG

at the top, because dev_dbg() is defined to do nothing if DEBUG isn't 
defined as a preprocessor symbol.

Similarly, snd_printdd() can be translated to a macro that expands to 
dev_dbg when CONFIG_SND_VERBOSE_DEBUG is enabled, and to nothing 
otherwise.

Does this seem reasonable?

Alan Stern



More information about the Alsa-devel mailing list