Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jin-Young Park <mcjin02@gmail.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: wrong print debugging message code
Date: Mon, 23 Jun 2008 12:55:57 +0200	[thread overview]
Message-ID: <s5habhc4dz6.wl%tiwai@suse.de> (raw)
In-Reply-To: <280b69ac0806202244s11e74363l4de3f020fed849be@mail.gmail.com>

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

  reply	other threads:[~2008-06-23 10:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-21  5:44 wrong print debugging message code Jin-Young Park
2008-06-23 10:55 ` Takashi Iwai [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5habhc4dz6.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=mcjin02@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox