[patch 1/5] kexec debug output improvments
Vivek Goyal
vgoyal at in.ibm.com
Wed May 9 00:19:25 EDT 2007
On Tue, May 08, 2007 at 06:11:56PM -0700, Geoff Levand wrote:
> Vivek Goyal wrote:
> > On Tue, May 08, 2007 at 07:36:45AM -0700, Geoff Levand wrote:
> >> Vivek Goyal wrote:
> >> > On Mon, May 07, 2007 at 05:02:47PM -0700, Geoff Levand wrote:
> >> >> +#define dprintf(args...) dfprintf(stdout, args)
> >> >> #ifdef DEBUG
> >> >> -#define dfprintf(args...) do {fprintf(args);} while(0)
> >> >> +#define dfprintf(_f, _args...) do {fprintf(_f, _args);} while(0)
> >> >
> >> > Should't dprintf() also be inside #ifdef DEBUG?
> >>
> >> Then you need two identical defs for dprintf.
> >>
> >
> > Nope.
> >
> > This is a debug print and should be enabled only if DEBUG is defined.
>
> I have that, but you cut that part of the patch which shows it
> from your reply.
Ok. You seem to be saying that because dfprintf() is under DEBUG, and
dprintf() is just a variant of dfprintf() so we don't have to put dprintf()
under debug.
I still feel that we should move dprintf() under DEBUG, in case definition
of dprintf() changes tomorrow and it is no more dependent on dfprintf().
It will not be very intitutive to the person changing the definition that
dprintf() now should be moved inside DEBUG.
#ifdef DEBUG
dprintf() dfprintf()
dfprintf() fprintf
#else
dprintf do{} while(0)
dfprintf() do{} while(0)
#endif
More information about the kexec
mailing list