mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Guan Xuetao" <guanxuetao@mprc.pku.edu.cn>
To: "'Arnd Bergmann'" <arnd@arndb.de>
Cc: "'Miguel Ojeda'" <miguel.ojeda.sandonis@gmail.com>,
	<linux-arch@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: RE: [PATCHv1 008/211] unicore32: new file arch/unicore32/boot/compressed/misc.c
Date: Mon, 13 Dec 2010 14:50:13 +0800	[thread overview]
Message-ID: <004a01cb9a92$02629930$0727cb90$@mprc.pku.edu.cn> (raw)
In-Reply-To: <201012111456.07925.arnd@arndb.de>


> > > > +/* 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




      parent reply	other threads:[~2010-12-13  6:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  9:38 Guan Xuetao
2010-12-09 18:33 ` Miguel Ojeda
     [not found]   ` <028901cb9933$4a2bfe10$de83fa30$@mprc.pku.edu.cn>
     [not found]     ` <201012111456.07925.arnd@arndb.de>
2010-12-13  6:50       ` Guan Xuetao [this message]

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='004a01cb9a92$02629930$0727cb90$@mprc.pku.edu.cn' \
    --to=guanxuetao@mprc.pku.edu.cn \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®