Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265164

Re: [PATCH 01/14] tty: Improve tty_debug() macro

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH 01/14] tty: Improve tty_debug() macro
Date 2015-11-08 20:00 +0100
Message-ID <qsDm2-3Qo-5@gated-at.bofh.it> (permalink)
References <qsCzD-3xF-3@gated-at.bofh.it> <qsCzD-3xF-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/14] tty core printk cleanup Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 06/14] tty: Define tty_*() printk macros Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 03/14] tty: synclink_gt: Rename tty_driver_name Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 01/14] tty: Improve tty_debug() macro Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
    Re: [PATCH 01/14] tty: Improve tty_debug() macro Joe Perches <joe@perches.com> - 2015-11-08 20:00 +0100
      Re: [PATCH 01/14] tty: Improve tty_debug() macro Joe Perches <joe@perches.com> - 2015-11-08 20:40 +0100
      Re: [PATCH 01/14] tty: Improve tty_debug() macro Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 20:40 +0100
  [PATCH 12/14] tty: Remove __func__ from tty_debug() macro Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 10/14] tty: Remove unset_locked_termios() error message Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 05/14] tty: core: Add helper fn to deref tty driver name Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 14/14] tty: core: Prefer dev_dbg() over pr_debug() Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 08/14] tty: core: Add driver name to invalid device registration message Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 13/14] tty: Merge conditional + error message + WARN_ON() Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 09/14] tty: core: Refactor parameters for unset_locked_termios() helper Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100
  [PATCH 11/14] tty: core: Prefer pr_* to printk(*) Peter Hurley <peter@hurleysoftware.com> - 2015-11-08 19:10 +0100

csiph-web