Re: [PATCH 05/39] wimax: debug macros and debug settings for the WiMAX stack

Johannes Berg
2008-11-27T09:28:56Z

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

On Wed, 2008-11-26 at 15:07 -0800, Inaky Perez-Gonzalez wrote:
> This file contains a simple debug framework that is used in the stack;
^^^^^ ??

> it allows the debug level to be controlled at compile-time (so the
> debug code is optimized out) and at run-time (for what wasn't compiled
> out).

Recently we got new stuff for dynamic printk
(include/linux/dynamic_printk.h) and pr_debug with a start format
(include/linux/kernel.h, pr_fmt); can you use any of that to make this
smaller? If not, I think you ought to argue why not, and possibly
improve the generic facility.

Personally, I'm tired of seeing every Intel driver come with a new huge
set of debugging macros that are barely understandable.

> +#define _d_printf(l, tag, dev, f, a...) \
> +do { \
> + char head[64]; \
> + if (!d_test(l)) \
> + break; \
> + __d_head(head, sizeof(head), dev); \
> + printk(KERN_ERR "%s%s%s: " f, head, __func__, tag, ##a); \
> +} while (0 && dev)

That && dev is wrong.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]