From: Jason Baron <jbaron@redhat.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Greg K-H <greg@kroah.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Make DEBUG take precedence over DYNAMIC_PRINTK_DEBUG (v2)
Date: Thu, 4 Dec 2008 11:44:40 -0500 [thread overview]
Message-ID: <20081204164440.GB3130@redhat.com> (raw)
In-Reply-To: <20081204165547.4787d1e9@gondolin>
On Thu, Dec 04, 2008 at 04:55:47PM +0100, Cornelia Huck wrote:
> Statically defined DEBUG should take precedence over
> dynamically enabled debugging; otherwise adding DEBUG
> (like, for example, via CONFIG_DEBUG_KOBJECT) does not
> have the expected result of printing pr_debug() and dev_dbg()
> messages unconditionally.
>
> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> ---
> include/linux/device.h | 8 ++++----
> include/linux/kernel.h | 8 ++++----
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> --- linux-2.6.orig/include/linux/kernel.h
> +++ linux-2.6/include/linux/kernel.h
> @@ -338,13 +338,13 @@ static inline char *pack_hex_byte(char *
> printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
>
> /* If you are writing a driver, please use dev_dbg instead */
> -#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
> +#if defined(DEBUG)
> +#define pr_debug(fmt, ...) \
> + printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> +#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
> #define pr_debug(fmt, ...) do { \
> dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \
> } while (0)
> -#elif defined(DEBUG)
> -#define pr_debug(fmt, ...) \
> - printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> #else
> #define pr_debug(fmt, ...) \
> ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
> --- linux-2.6.orig/include/linux/device.h
> +++ linux-2.6/include/linux/device.h
> @@ -553,13 +553,13 @@ extern const char *dev_driver_string(con
> #define dev_info(dev, format, arg...) \
> dev_printk(KERN_INFO , dev , format , ## arg)
>
> -#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
> +#if defined(DEBUG)
> +#define dev_dbg(dev, format, arg...) \
> + dev_printk(KERN_DEBUG , dev , format , ## arg)
> +#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
> #define dev_dbg(dev, format, ...) do { \
> dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
> } while (0)
> -#elif defined(DEBUG)
> -#define dev_dbg(dev, format, arg...) \
> - dev_printk(KERN_DEBUG , dev , format , ## arg)
> #else
> #define dev_dbg(dev, format, arg...) \
> ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
looks good.
Acked-by: Jason Baron <jbaron@redhat.com>
thanks,
-Jason
prev parent reply other threads:[~2008-12-04 16:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 13:52 [PATCH] DEBUG_KOBJECT vs. DYNAMIC_PRINTK_DEBUG Cornelia Huck
2008-12-03 20:12 ` Jason Baron
2008-12-04 12:48 ` Cornelia Huck
2008-12-04 12:51 ` [PATCH] Make DEBUG take precedence over DYNAMIC_PRINTK_DEBUG Cornelia Huck
2008-12-04 14:42 ` Jason Baron
2008-12-04 15:55 ` [PATCH] Make DEBUG take precedence over DYNAMIC_PRINTK_DEBUG (v2) Cornelia Huck
2008-12-04 16:44 ` Jason Baron [this message]
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=20081204164440.GB3130@redhat.com \
--to=jbaron@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.