lkml.org 
[lkml]   [2006]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch] statistics infrastructure - update 9
> +#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 :)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-04 08:21    [W:0.071 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site