mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Martin Peschke <mp3@de.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>,
	clg@fr.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: [Patch] statistics infrastructure - update 9
Date: Tue, 4 Jul 2006 08:17:54 +0200	[thread overview]
Message-ID: <20060704061754.GB9417@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1151943862.2936.10.camel@dyn-9-152-230-71.boeblingen.de.ibm.com>

> +#else /* !CONFIG_STATISTICS */
> +/* These NOP functions unburden clients from handling !CONFIG_STATISTICS. */
> +
> +static inline int statistic_create(struct statistic_interface *interface,
> +				   const char *name)
> +{
> +	return 0;
> +}
> +
> +static inline int statistic_remove(struct statistic_interface *interface)
> +{
> +	return 0;
> +}
> +
> +static inline void statistic_set(struct statistic *stat, int i,
> +				 s64 value, u64 total)
> +{
> +}
> +
> +static inline void _statistic_add(struct statistic *stat, int i,
> +				  s64 value, u64 incr)
> +{
> +}
> +
> +static inline void statistic_add(struct statistic *stat, int i,
> +				 s64 value, u64 incr)
> +{
> +}
> +
> +static inline void _statistic_add_as(int type, struct statistic *stat, int i,
> +				     s64 value, u64 incr)
> +{
> +}
> +
> +static inline void statistic_add_as(int type, struct statistic *stat, int i,
> +				    s64 value, u64 incr)
> +{
> +}
> +
> +#endif /* CONFIG_STATISTICS */

Why not have something like:

#define statistic_create(interface, name) 	({ 0; })
#define statistic_remove(interface)		({ 0; })
#define statistic_set(stat, i, value, total)	do { } while (0)
...

That would be much shorter and easier to read. But maybe it's just me :)

  parent reply	other threads:[~2006-07-04  6:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03 16:24 Martin Peschke
2006-07-03 16:41 ` Cedric Le Goater
2006-07-04  0:17 ` Andi Kleen
2006-07-06 16:55   ` Martin Peschke
2006-07-06 17:00     ` Andi Kleen
2006-07-10 14:41       ` Martin Peschke
2006-07-04  6:17 ` Heiko Carstens [this message]
2006-07-04  7:19   ` Andrew Morton

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=20060704061754.GB9417@osiris.boeblingen.de.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=akpm@osdl.org \
    --cc=clg@fr.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mp3@de.ibm.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®