RE: [PATCHv1 008/211] unicore32: new file arch/unicore32/boot/compressed/misc.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > > > +/* Diagnostic functions */
> > > > +#ifdef DEBUG
> > > > +#  define Assert(cond, msg)    { if (!(cond)) error(msg); }
> > > > +#  define Trace(x)             fprintf x
> > > > +#  define Tracev(x)            { if (verbose)                  fprintf x; }
> > > > +#  define Tracevv(x)           { if (verbose > 1)              fprintf x; }
> > > > +#  define Tracec(c, x)         { if (verbose && (c))           fprintf x; }
> > > > +#  define Tracecv(c, x)                { if ((verbose > 1) && (c))
> > > > fprintf x; }
> > >
> > > Maybe uppercase? Maybe do { ... } while(0)?
> >
> > Uppercase  for what? Tracexx to tracexx?
> 
> We normally don't have mixed-case identifiers, normally it would be
> trace() for functions vs. TRACE() for macros, though we also have a
> lot of lower-case macros as well.
> 
> For the debugging macros, I would generally recommend not having
> any, but simply using the standard pr_debug and dev_dbg macros
> that everyone knows and understands.
> 
> If you really need to do macros, make them so that they work like
> functions, e.g.
> 
> #define foo_tracev(...) do { if (verbose) fprintf(__va_args__); } while (0)

When reviewing misc.c, I find that Tracevv and Tracecv are not used in lib/decompress_inflate.c
So these macros could be removed directly.
The same for other architectures, I think.

Guan Xuetao



--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux