[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1447008694.2701.28.camel@perches.com>
Date: Sun, 08 Nov 2015 10:51:34 -0800
From: Joe Perches <joe@...ches.com>
To: Peter Hurley <peter@...leysoftware.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jiri Slaby <jslaby@...e.cz>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/14] tty: Improve tty_debug() macro
On Sun, 2015-11-08 at 13:01 -0500, Peter Hurley wrote:
> Incorporate suggestions for tty core debug macro improvements
> - printk(KERN_DEBUG) => pr_debug()
> - ##args => ##__VA_ARGS__
> - remove do {} while()
> - output tty_name() first
[]
> diff --git a/include/linux/tty.h b/include/linux/tty.h
[]
> @@ -667,10 +667,7 @@ static inline void proc_tty_register_driver(struct tty_driver *d) {}
> static inline void proc_tty_unregister_driver(struct tty_driver *d) {}
> #endif
>
> -#define tty_debug(tty, f, args...) \
> - do { \
> - printk(KERN_DEBUG "%s: %s: " f, __func__, \
> - tty_name(tty), ##args); \
> - } while (0)
> +#define tty_debug(tty, f, ...) \
> + pr_debug("%s: %s: " f, tty_name(tty), __func__, ##__VA_ARGS__)
>
> #endif
Unless there's a #define DEBUG in the path, this now
basically requires dynamic debugging to output anything.
Given that, I suggest removing __func__ from the output
because dynamic debugging can add it.
And f is more commonly fmt, so:
#define tty_debug(tty, fmt, ...) \
pr_debug("%s: " fmt, tty_name(tty), ##__VA_ARGS__)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists