* wrong print debugging message code
@ 2008-06-21 5:44 Jin-Young Park
2008-06-23 10:55 ` Takashi Iwai
0 siblings, 1 reply; 8+ messages in thread
From: Jin-Young Park @ 2008-06-21 5:44 UTC (permalink / raw)
To: alsa-devel
Hello,
I written ASoC Audio driver for our company chip in linux kernel 2.6.24.1.
New kernel 2.6.25.7 released before several days.
So, I merge my ASoC Audio dirver to kernel 2.6.25.7.
then I found wrong code that print debuuging message code in several files.
These file location is kernel_src/sound/soc/codecs for SoC audio codec
drvier files
These files include follow define code for print debug message.
------------------------------------------------------------------------------------------------------------------------
#define XXXX_DEBUG 0
#ifdef XXXX_DEBUG
#define dbg(format, arg...) \
printk(KERN_DEBUG AUDIO_NAME ": " format "\n" , ## arg)
#else
#define dbg(format, arg...) do {} while (0)
#endif
------------------------------------------------------------------------------------------------------------------------
I think "#ifdef XXXX_DEBUG" line is wrong. Because, XXXX_DEBUG was already
defined 0.
I known that "#ifdef" is only check defined or not defined, 0 or 1(false or
true) are not check.
"#if XXXX_DEBUG" code is more correct than "#ifdef XXXX_DEBUG".
thanks
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: wrong print debugging message code
2008-06-21 5:44 wrong print debugging message code Jin-Young Park
@ 2008-06-23 10:55 ` Takashi Iwai
2008-06-23 11:12 ` Mark Brown
2008-06-23 18:18 ` Jin-Young Park
0 siblings, 2 replies; 8+ messages in thread
From: Takashi Iwai @ 2008-06-23 10:55 UTC (permalink / raw)
To: Jin-Young Park; +Cc: alsa-devel, Mark Brown
At Sat, 21 Jun 2008 14:44:47 +0900,
Jin-Young Park wrote:
>
> Hello,
>
> I written ASoC Audio driver for our company chip in linux kernel 2.6.24.1.
> New kernel 2.6.25.7 released before several days.
> So, I merge my ASoC Audio dirver to kernel 2.6.25.7.
> then I found wrong code that print debuuging message code in several files.
> These file location is kernel_src/sound/soc/codecs for SoC audio codec
> drvier files
>
> These files include follow define code for print debug message.
>
> ------------------------------------------------------------------------------------------------------------------------
> #define XXXX_DEBUG 0
>
> #ifdef XXXX_DEBUG
> #define dbg(format, arg...) \
> printk(KERN_DEBUG AUDIO_NAME ": " format "\n" , ## arg)
> #else
> #define dbg(format, arg...) do {} while (0)
> #endif
> ------------------------------------------------------------------------------------------------------------------------
>
> I think "#ifdef XXXX_DEBUG" line is wrong. Because, XXXX_DEBUG was already
> defined 0.
> I known that "#ifdef" is only check defined or not defined, 0 or 1(false or
> true) are not check.
> "#if XXXX_DEBUG" code is more correct than "#ifdef XXXX_DEBUG".
#ifdef XXX_DEBUG is more common than #if XXX_DEBUG in the kernel
tree. So, I'd suggest to keep #ifdef style.
The confusing thing is that it defines to '0' (and I'm not sure the
debug is activated as default in the current code -- Mark, Liam, is it
intentional?).
IMO, the debug should be basically off as default, and if enabled, it
should be defined to '1'.
Takashi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: wrong print debugging message code
2008-06-23 10:55 ` Takashi Iwai
@ 2008-06-23 11:12 ` Mark Brown
2008-06-23 12:13 ` Takashi Iwai
2008-06-23 18:18 ` Jin-Young Park
1 sibling, 1 reply; 8+ messages in thread
From: Mark Brown @ 2008-06-23 11:12 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Jin-Young Park
On Mon, Jun 23, 2008 at 12:55:57PM +0200, Takashi Iwai wrote:
> The confusing thing is that it defines to '0' (and I'm not sure the
> debug is activated as default in the current code -- Mark, Liam, is it
> intentional?).
I doubt it.
> IMO, the debug should be basically off as default, and if enabled, it
> should be defined to '1'.
Really they should all just be deleted and replaced by the standard
pr_() macros but if we wait for v2 then we'd be able to use the dev_()
variants instead.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: wrong print debugging message code
2008-06-23 11:12 ` Mark Brown
@ 2008-06-23 12:13 ` Takashi Iwai
2008-06-23 12:17 ` Mark Brown
0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2008-06-23 12:13 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Jin-Young Park
At Mon, 23 Jun 2008 12:12:28 +0100,
Mark Brown wrote:
>
> On Mon, Jun 23, 2008 at 12:55:57PM +0200, Takashi Iwai wrote:
>
> > The confusing thing is that it defines to '0' (and I'm not sure the
> > debug is activated as default in the current code -- Mark, Liam, is it
> > intentional?).
>
> I doubt it.
>
> > IMO, the debug should be basically off as default, and if enabled, it
> > should be defined to '1'.
>
> Really they should all just be deleted and replaced by the standard
> pr_() macros but if we wait for v2 then we'd be able to use the dev_()
> variants instead.
It depends on your plan. Definitely nice to fix it for 2.6.27,
though.
Takashi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: wrong print debugging message code
2008-06-23 12:13 ` Takashi Iwai
@ 2008-06-23 12:17 ` Mark Brown
0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2008-06-23 12:17 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Jin-Young Park
On Mon, Jun 23, 2008 at 02:13:19PM +0200, Takashi Iwai wrote:
> It depends on your plan. Definitely nice to fix it for 2.6.27,
> though.
I've actually just written a patch ripping them all out (I'd probably
have submitted it already if I hadn't been reviewing Ben's changes) -
turns out that none of the drivers were actually using their dbg()
macros anyway so it won't have any runtime effect, though obviously a
fix would still be good.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: wrong print debugging message code
2008-06-23 10:55 ` Takashi Iwai
2008-06-23 11:12 ` Mark Brown
@ 2008-06-23 18:18 ` Jin-Young Park
2008-06-23 18:51 ` Mark Brown
1 sibling, 1 reply; 8+ messages in thread
From: Jin-Young Park @ 2008-06-23 18:18 UTC (permalink / raw)
To: Takashi Iwai, alsa-devel, Mark Brown, Liam Girdwood
Hello.
I tested the code that "#define XXXX_DEBUG 0" on our company EVB with
WM8960.
I defined "#define XXXX_DEBUG 0" and dbg() put into mute
function(wm8960_digital_mute()).
After linux boot, played audio file.
My test dbg() message was not print terminal, but I find dbg() code was
working exactly.
Excuted dmesg command, then it was print that logged dbg() messages.
I think, it maybe potential that reduce performance before one knows.
Thanks.
Jinyoung Park.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: wrong print debugging message code
2008-06-23 18:18 ` Jin-Young Park
@ 2008-06-23 18:51 ` Mark Brown
2008-06-24 5:55 ` Jin-Young Park
0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2008-06-23 18:51 UTC (permalink / raw)
To: Jin-Young Park; +Cc: Takashi Iwai, alsa-devel
On Tue, Jun 24, 2008 at 03:18:49AM +0900, Jin-Young Park wrote:
> I defined "#define XXXX_DEBUG 0" and dbg() put into mute
> function(wm8960_digital_mute()).
The WM8960 driver isn't in the standard Linux kernel yet, it is currently
distributed via the Wolfson web site. None of the drivers included in
the standard Linux kernel were using their dbg() macros, though some had
such macros present.
> I think, it maybe potential that reduce performance before one knows.
The performance impact should be very minor - the digital mute is not
used in any hot paths and the output will only go do the dmesg buffer by
default so won't have the overhead of writing to the console.
Out of interest, which platform are you working with?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: wrong print debugging message code
2008-06-23 18:51 ` Mark Brown
@ 2008-06-24 5:55 ` Jin-Young Park
0 siblings, 0 replies; 8+ messages in thread
From: Jin-Young Park @ 2008-06-24 5:55 UTC (permalink / raw)
To: Jin-Young Park, Takashi Iwai, alsa-devel, Liam Girdwood
I get the point your explanation. Thanks.
> Out of interest, which platform are you working with?
I working at Mtekvision in Korea.
Mtekvision is fabless company, development MMP and ISP.
you know? Anyway, my development platform is
MV86XX series(MMP) with Wolfson Codecs(WM8960, 8973, 8983, 9713 ...)
and Linux kernel 2.6.25.7 <tr_1214286468096>.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-06-24 5:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-21 5:44 wrong print debugging message code Jin-Young Park
2008-06-23 10:55 ` Takashi Iwai
2008-06-23 11:12 ` Mark Brown
2008-06-23 12:13 ` Takashi Iwai
2008-06-23 12:17 ` Mark Brown
2008-06-23 18:18 ` Jin-Young Park
2008-06-23 18:51 ` Mark Brown
2008-06-24 5:55 ` Jin-Young Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox