kernel.h: add pr_warn for symmetry to dev_warn, netdev_warn

The current logging macros are
pr_<level>, dev_<level>, netdev_<level>, and netif_<level>.
pr_ uses warning, the other use warn.

Standardize these logging macros a bit more by adding pr_warn and
pr_warn_ratelimited.

Right now, there are:

$ for level in emerg alert crit err warn warning notice info ; do \
    for prefix in pr dev netdev netif ; do \
      echo -n "${prefix}_${level}:	`git grep -w "${prefix}_${level}" | wc -l`	" ; \
    done ; \
    echo ; \
  done
pr_emerg: 	45	dev_emerg: 	4	netdev_emerg: 	1	netif_emerg: 	4
pr_alert: 	24	dev_alert: 	36	netdev_alert: 	1	netif_alert: 	6
pr_crit: 	24	dev_crit: 	22	netdev_crit: 	1	netif_crit: 	4
pr_err:  	2013	dev_err: 	8467	netdev_err: 	267	netif_err: 	240
pr_warn: 	0	dev_warn: 	1818	netdev_warn: 	126	netif_warn: 	23
pr_warning: 	773	dev_warning: 	0	netdev_warning:	0	netif_warning: 	0
pr_notice: 	148	dev_notice: 	111	netdev_notice: 	9	netif_notice: 	3
pr_info: 	1717	dev_info: 	3007	netdev_info: 	101	netif_info: 	85

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Joe Perches 2010-05-24 14:33:08 -07:00 committed by Linus Torvalds
parent 4c99000ac4
commit fc62f2f19e

View File

@ -389,6 +389,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
#define pr_warning(fmt, ...) \ #define pr_warning(fmt, ...) \
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
#define pr_warn pr_warning
#define pr_notice(fmt, ...) \ #define pr_notice(fmt, ...) \
printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
#define pr_info(fmt, ...) \ #define pr_info(fmt, ...) \
@ -447,6 +448,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
#define pr_warning_ratelimited(fmt, ...) \ #define pr_warning_ratelimited(fmt, ...) \
printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
#define pr_warn_ratelimited pr_warning_ratelimited
#define pr_notice_ratelimited(fmt, ...) \ #define pr_notice_ratelimited(fmt, ...) \
printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
#define pr_info_ratelimited(fmt, ...) \ #define pr_info_ratelimited(fmt, ...) \