Re: [RPC] OLPC tablet input driver.

From: Greg KH
Date: Wed Aug 30 2006 - 00:44:17 EST


On Tue, Aug 29, 2006 at 04:44:43AM -0400, Zephaniah E. Hull wrote:
> On Tue, Aug 29, 2006 at 10:10:19AM +0200, Arjan van de Ven wrote:
> > > +#undef DEBUG
> > > +#ifdef DEBUG
> > > +#define dbg(format, arg...) printk(KERN_INFO "olpc.c(%d): " format "\n", __LINE__, ## arg)
> > > +#else
> > > +#define dbg(format, arg...) do {} while (0)
> > > +#endif
> >
> > why not use pr_debug or even dev_debug() ?
> > Those already have this ifdef included
>
> I was not thinking of them at the time, however dev_dbg is not an option
> because we do not have a struct device at hand when we want to print
> some debugging lines.

Then use it for the majority of the places where you do have it, and do
pr_debug() when you do not.

> pr_debug might work, but I would rather have file and line already
> there.
>
> Though, admittedly, that would be a better argument if it used __FILE__
> there instead of hard coding it.

__FILE__ will return you a full path, which is what I do not think you
want...

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/