All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Nelson <james4765@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH for review] Changed DPRINTK to pr_debug
Date: Wed, 27 Dec 2006 01:11:45 +0000	[thread overview]
Message-ID: <4591C851.9080102@gmail.com> (raw)
In-Reply-To: <4b4be04a0612251633j4b86e7efqaa5e7742a542f64b@mail.gmail.com>

Badai Aqrandista wrote:
 > Hi,
 >
 > I'm learning to hack on linux kernel. This is a patch to do one of the
 > point in the kernel janitor todo list. What do you think? Should I
 > continue working on this or should I choose different point in the
 > todo list?
 >
 > My basic concern is that the author of via82cxxx_audio.c is expecting
 > VIA_DEBUG symbol when he is working with the code.
 >
 > diff --git a/include/linux/kernel.h b/include/linux/kernel.h
 > index b0c4a05..484a401 100644
 > --- a/include/linux/kernel.h
 > +++ b/include/linux/kernel.h
 > @@ -203,7 +203,7 @@ extern void dump_stack(void);
 >  #ifdef DEBUG
 >  /* If you are writing a driver, please use dev_dbg instead */
 >  #define pr_debug(fmt,arg...) \
 > -	printk(KERN_DEBUG fmt,##arg)
 > +	printk(KERN_DEBUG "[%s] " fmt, __FUNCTION__, ##arg)
 >  #else
 >  static inline int __attribute__ ((format (printf, 1, 2)))
 > pr_debug(const char * fmt, ...)
 >  {

I definitely would not do this - a lot of driver-specific macros already include __FUNCTION__ in them, and this would 
mess up their output.

 > diff --git a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
 > index c96cc8c..605be65 100644
 > --- a/sound/oss/via82cxxx_audio.c
 > +++ b/sound/oss/via82cxxx_audio.c
 > @@ -45,14 +45,6 @@
 >  #include "mpu401.h"
 >
 >
 > -#undef VIA_DEBUG	/* define to enable debugging output and checks */
 > -#ifdef VIA_DEBUG
 > -/* note: prints function name for you */
 > -#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt,
 > __FUNCTION__ , ## args)
 > -#else
 > -#define DPRINTK(fmt, args...)
 > -#endif
 > -
 >  #undef VIA_NDEBUG	/* define to disable lightweight runtime checks */
 >  #ifdef VIA_NDEBUG
 >  #define assert(expr)

Plus, a lot of driver authors choose not to have their debug printk's tied into a global flag - you could change this 
whole patch to:


+#undef DEBUG		/* define to enable debugging output and checks */
-#undef VIA_DEBUG	/* define to enable debugging output and checks */
-#ifdef VIA_DEBUG
-/* note: prints function name for you */
-#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
+#define DPRINTK(fmt, args...) pr_debug("via82cxxx: %s(): ", fmt, __FUNCTION__, ## args)
-#else
-#define DPRINTK(fmt, args...)
-#endif



P. S. - your mail client mangled the patch - I use sendpatchset.py (http://www.speakeasy.org/~pj99/sgi/sendpatchset) to 
submit patches, and the latest version is designed to play nice with gmail...

Jim

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  reply	other threads:[~2006-12-27  1:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-26  0:33 [KJ] [PATCH for review] Changed DPRINTK to pr_debug Badai Aqrandista
2006-12-27  1:11 ` Jim Nelson [this message]
2006-12-27 23:29 ` Badai Aqrandista

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=4591C851.9080102@gmail.com \
    --to=james4765@gmail.com \
    --cc=kernel-janitors@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.