[PATCH 4/6] ehea: header files

Arnd Bergmann arnd.bergmann at de.ibm.com
Wed Aug 9 23:17:36 EST 2006


On Wednesday 09 August 2006 10:39, Jan-Bernd Themann wrote:
> +extern int ehea_trace_level;
> +
> +#ifdef EHEA_NO_EDEB
> +#define EDEB_P_GENERIC(level, idstring, format, args...) \
> +       while (0 == 1) { \
> +           if(unlikely (level <= ehea_trace_level)) { \
> +                       printk("%s " idstring " "format "\n", \
> +                               __func__, ##args); \
> +         } \
> +       } \
> +
> +#else
> +
> +#define EDEB_P_GENERIC(level,idstring,format,args...) \
> +if (level < KEEP_EDEBS_BELOW) { \
> +       do { \
> +           if(unlikely (level <= ehea_trace_level)) { \
> +                       printk("%s " idstring " "format "\n", \
> +                               __func__, ##args); \
> +         } \
> +       } while (1 == 0); \
> +}
> +#endif
> +
> +#define EDEB(level, format, args...) \
> +        EDEB_P_GENERIC(level, "", format, ##args)
> +
> +#define EDEB_ERR(level, format, args...) \
> +        EDEB_P_GENERIC(level, "EHEA_ERROR", format, ##args)
> +
> +#define EDEB_EN(level, format, args...) \
> +        EDEB_P_GENERIC(level, ">>>", format, ##args)
> +
> +#define EDEB_EX(level, format, args...) \
> +        EDEB_P_GENERIC(level, "<<<", format, ##args)

Please don't invent your own debugging macros. You can either use the
pr_debug/pr_info facility from <linux/kernel.h> or get rid of those
completely. The latter is probably preferred for most of your calls.

	Arnd <><



More information about the Linuxppc-dev mailing list