linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CONFIG_MTD_DEBUG vs generic DEBUG support in kernel.h
@ 2010-03-16 12:55 Ferenc Wagner
  2010-03-16 13:05 ` Artem Bityutskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Ferenc Wagner @ 2010-03-16 12:55 UTC (permalink / raw)
  To: linux-mtd, linux-kernel

Hi,

include/linux/mtd/mtd.h contains the following snippet:

#ifdef CONFIG_MTD_DEBUG
#define DEBUG(n, args...)                               \
        do {                                            \
                if (n <= CONFIG_MTD_DEBUG_VERBOSE)      \
                        printk(KERN_INFO args);         \
        } while(0)

which conflicts with the generic debugging support in
include/linux/kernel.h:

#ifdef DEBUG
#define pr_devel(fmt, ...) \
        printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)

(that is, gcc emits redefinition warnings on modules which
#define DEBUG on their own and also include mtd.h)
Unfortunately, the DEBUG macro is used rather heavily under
drivers/mtd.  Should we resolve this somehow or is it better
to just live with it?

(Please keep me on Cc, I'm not subscribed.)
-- 
Thanks,
Feri.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: CONFIG_MTD_DEBUG vs generic DEBUG support in kernel.h
  2010-03-16 12:55 CONFIG_MTD_DEBUG vs generic DEBUG support in kernel.h Ferenc Wagner
@ 2010-03-16 13:05 ` Artem Bityutskiy
  2010-03-18 16:20   ` Ferenc Wagner
  0 siblings, 1 reply; 5+ messages in thread
From: Artem Bityutskiy @ 2010-03-16 13:05 UTC (permalink / raw)
  To: Ferenc Wagner; +Cc: linux-mtd, linux-kernel

On Tue, 2010-03-16 at 13:55 +0100, Ferenc Wagner wrote:
> Hi,
> 
> include/linux/mtd/mtd.h contains the following snippet:
> 
> #ifdef CONFIG_MTD_DEBUG
> #define DEBUG(n, args...)                               \
>         do {                                            \
>                 if (n <= CONFIG_MTD_DEBUG_VERBOSE)      \
>                         printk(KERN_INFO args);         \
>         } while(0)
> 
> which conflicts with the generic debugging support in
> include/linux/kernel.h:
> 
> #ifdef DEBUG
> #define pr_devel(fmt, ...) \
>         printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> 
> (that is, gcc emits redefinition warnings on modules which
> #define DEBUG on their own and also include mtd.h)
> Unfortunately, the DEBUG macro is used rather heavily under
> drivers/mtd.  Should we resolve this somehow or is it better
> to just live with it?
> 
> (Please keep me on Cc, I'm not subscribed.)

IMO, this MTD debug stuff is not very useful and could be just killed.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: CONFIG_MTD_DEBUG vs generic DEBUG support in kernel.h
  2010-03-16 13:05 ` Artem Bityutskiy
@ 2010-03-18 16:20   ` Ferenc Wagner
  2010-03-19  0:36     ` Wolfram Sang
  2010-04-08  8:06     ` Artem Bityutskiy
  0 siblings, 2 replies; 5+ messages in thread
From: Ferenc Wagner @ 2010-03-18 16:20 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd, linux-kernel

Artem Bityutskiy <dedekind1@gmail.com> writes:

> On Tue, 2010-03-16 at 13:55 +0100, Ferenc Wagner wrote:
> 
>> include/linux/mtd/mtd.h contains the following snippet:
>> 
>> #ifdef CONFIG_MTD_DEBUG
>> #define DEBUG(n, args...)                               \
>>         do {                                            \
>>                 if (n <= CONFIG_MTD_DEBUG_VERBOSE)      \
>>                         printk(KERN_INFO args);         \
>>         } while(0)
>> 
>> which conflicts with the generic debugging support in
>> include/linux/kernel.h:
>> 
>> #ifdef DEBUG
>> #define pr_devel(fmt, ...) \
>>         printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
>> 
>> (that is, gcc emits redefinition warnings on modules which
>> #define DEBUG on their own and also include mtd.h)
>> Unfortunately, the DEBUG macro is used rather heavily under
>> drivers/mtd.  Should we resolve this somehow or is it better
>> to just live with it?
>
> IMO, this MTD debug stuff is not very useful and could be just killed.

Well, I found the mtdcore debugging somewhat useful.  But anyway,
killing it would be about as much work as renaming the macro, or using
something standard as dev_(v)dbg or pr_debug/devel (btw. what's the
difference?) instead.  I'm willing to do some mechanical work on either
one if you wish.
-- 
Regards,
Feri.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: CONFIG_MTD_DEBUG vs generic DEBUG support in kernel.h
  2010-03-18 16:20   ` Ferenc Wagner
@ 2010-03-19  0:36     ` Wolfram Sang
  2010-04-08  8:06     ` Artem Bityutskiy
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2010-03-19  0:36 UTC (permalink / raw)
  To: Ferenc Wagner; +Cc: dedekind1, linux-mtd, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

> something standard as dev_(v)dbg or pr_debug/devel (btw. what's the
> difference?) instead.

pr_devel will never produce code if !DEBUG. For pr_debug, it may be different
as we have DYNAMIC_DEBUG meanwhile (see kernel.h)

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: CONFIG_MTD_DEBUG vs generic DEBUG support in kernel.h
  2010-03-18 16:20   ` Ferenc Wagner
  2010-03-19  0:36     ` Wolfram Sang
@ 2010-04-08  8:06     ` Artem Bityutskiy
  1 sibling, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2010-04-08  8:06 UTC (permalink / raw)
  To: Ferenc Wagner; +Cc: linux-mtd, linux-kernel

On Thu, 2010-03-18 at 17:20 +0100, Ferenc Wagner wrote:
> Artem Bityutskiy <dedekind1@gmail.com> writes:
> 
> > On Tue, 2010-03-16 at 13:55 +0100, Ferenc Wagner wrote:
> > 
> >> include/linux/mtd/mtd.h contains the following snippet:
> >> 
> >> #ifdef CONFIG_MTD_DEBUG
> >> #define DEBUG(n, args...)                               \
> >>         do {                                            \
> >>                 if (n <= CONFIG_MTD_DEBUG_VERBOSE)      \
> >>                         printk(KERN_INFO args);         \
> >>         } while(0)
> >> 
> >> which conflicts with the generic debugging support in
> >> include/linux/kernel.h:
> >> 
> >> #ifdef DEBUG
> >> #define pr_devel(fmt, ...) \
> >>         printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> >> 
> >> (that is, gcc emits redefinition warnings on modules which
> >> #define DEBUG on their own and also include mtd.h)
> >> Unfortunately, the DEBUG macro is used rather heavily under
> >> drivers/mtd.  Should we resolve this somehow or is it better
> >> to just live with it?
> >
> > IMO, this MTD debug stuff is not very useful and could be just killed.
> 
> Well, I found the mtdcore debugging somewhat useful.  But anyway,
> killing it would be about as much work as renaming the macro, or using
> something standard as dev_(v)dbg or pr_debug/devel (btw. what's the
> difference?) instead.  I'm willing to do some mechanical work on either
> one if you wish.

Yeah, probalby you can transform them to dev_dbg. But the "levels" do
not seem to be available with dev_dbg, so I guess you could nuke some
higher level messages?

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-08  8:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-16 12:55 CONFIG_MTD_DEBUG vs generic DEBUG support in kernel.h Ferenc Wagner
2010-03-16 13:05 ` Artem Bityutskiy
2010-03-18 16:20   ` Ferenc Wagner
2010-03-19  0:36     ` Wolfram Sang
2010-04-08  8:06     ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).