include/net/cfg80211.h: wiphy_<level> messages use dev_printk
Subsystems (3)
RFC PATCH 1/1 include/net/cfg80211.h: wiphy_<level> messages use dev_printk
Adding device to the wiphy logging messages could be useful.
--- include/net/cfg80211.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/net/cfg80211.h +1 -1
@@ -2439,7 +2439,7 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,/* wiphy_printk helpers, similar to dev_printk */ #define wiphy_printk(level, wiphy, format, args...) \ - printk(level "%s: " format, wiphy_name(wiphy), ##args) + dev_printk(level, &wiphy->dev, "%s: " format, wiphy_name(wiphy), ##args) #define wiphy_emerg(wiphy, format, args...) \ wiphy_printk(KERN_EMERG, wiphy, format, ##args) #define wiphy_alert(wiphy, format, args...) \
Johannes Berg
maintainerinclude/net/cfg80211.h void cfg80211_cqm_rssi_notify(struct net_device *dev, · line 2442
Quoted 5 lines · Joe Perches
Adding device to the wiphy logging messages could be useful.
#define
wiphy_printk(level, wiphy, format, args...)\include/net/cfg80211.h +1
-1- printk(level "%s: " format, wiphy_name(wiphy), ##args) + dev_printk(level, &wiphy->dev, "%s: " format, wiphy_name(wiphy), ##args)
what will that actually print?
johannes
Quoted 6 lines · Johannes Berg
Review
Quoted 4 lines · Joe Perches
Adding device to the wiphy logging messages could be useful.
#definewiphy_printk(level, wiphy, format, args...)\(quoted diff) +1
-1- printk(level "%s: " format, wiphy_name(wiphy), ##args) + dev_printk(level, &wiphy->dev, "%s: " format, wiphy_name(wiphy), ##args)what will that actually print?
As is, that'd print:
"<level>dev_driver_string(&wiphy->dev) dev_name(&wiphy->dev): wiphy_name(wiphy): " fmt, ##args
for instance:
[ 41.261941] ieee80211 phy0: phy0: Selected rate control algorithm 'minstrel_ht'
ie: redundant.wiphy_name(wiphy) is an inline for dev_name(&wiphy->dev)
So it's appropriate to use:
#define wiphy_<level>(wiphy, fmt, arg...) dev_<level>(&wiphy->dev, fmt, ##arg)
and the output becomes:
[ 41.261941] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
--- include/net/cfg80211.h | 37 +++++++++++------------------------ net/wireless/core.c | 49 ------------------------------------------------ 2 files changed, 12 insertions(+), 74 deletions(-)
include/net/cfg80211.h +12 -25
@@ -2548,49 +2548,36 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,/* wiphy_printk helpers, similar to dev_printk */ #define wiphy_printk(level, wiphy, format, args...) \ - printk(level "%s: " format, wiphy_name(wiphy), ##args) + dev_printk(level, &(wiphy)->dev, format, ##args) #define wiphy_emerg(wiphy, format, args...) \ - wiphy_printk(KERN_EMERG, wiphy, format, ##args) + dev_emerg(&(wiphy)->dev, format, ##args) #define wiphy_alert(wiphy, format, args...) \ - wiphy_printk(KERN_ALERT, wiphy, format, ##args) + dev_alert(&(wiphy)->dev, format, ##args) #define wiphy_crit(wiphy, format, args...) \ - wiphy_printk(KERN_CRIT, wiphy, format, ##args) + dev_crit(&(wiphy)->dev, format, ##args) #define wiphy_err(wiphy, format, args...) \ - wiphy_printk(KERN_ERR, wiphy, format, ##args) + dev_err(&(wiphy)->dev, format, ##args) #define wiphy_warn(wiphy, format, args...) \ - wiphy_printk(KERN_WARNING, wiphy, format, ##args) + dev_warn(&(wiphy)->dev, format, ##args) #define wiphy_notice(wiphy, format, args...) \ - wiphy_printk(KERN_NOTICE, wiphy, format, ##args) + dev_notice(&(wiphy)->dev, format, ##args) #define wiphy_info(wiphy, format, args...) \ - wiphy_printk(KERN_INFO, wiphy, format, ##args) + dev_info(&(wiphy)->dev, format, ##args) -int wiphy_debug (const struct wiphy *wiphy,const char *format, ...) - __attribute__ ((format (printf,2 ,3 ))); - -#if defined(DEBUG ) -#define wiphy_dbg(wiphy, format, args...) \ +#define wiphy_debug(wiphy, format, args...) \ wiphy_printk(KERN_DEBUG, wiphy, format, ##args) -#elif defined(CONFIG_DYNAMIC_DEBUG ) + #define wiphy_dbg(wiphy, format, args...) \ - dynamic_pr_debug("%s: " format, wiphy_name(wiphy), ##args) -#else -#define wiphy_dbg(wiphy, format, args...) \ -({ \ - if (0) \ - wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ - 0; \ -}) -#endif + dev_dbg(&(wiphy)->dev, format, ##args)#if defined(VERBOSE_DEBUG )#define wiphy_vdbg wiphy_dbg#else - #define wiphy_vdbg(wiphy, format, args...) \ ({ \ if (0) \ wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ - 0; \ + 0; \ })#endif
net/wireless/core.c +0 -49
52 lines not on this page · raw message
Quoted 21 lines · Joe Perches
Quoted 6 lines · Johannes Berg
Review
Quoted 4 lines · Joe Perches
Adding device to the wiphy logging messages could be useful.
#definewiphy_printk(level, wiphy, format, args...)\(quoted diff) +1
-1- printk(level "%s: " format, wiphy_name(wiphy), ##args) + dev_printk(level, &wiphy->dev, "%s: " format, wiphy_name(wiphy), ##args)what will that actually print?
As is, that'd print:
"<level>dev_driver_string(&wiphy->dev)
dev_name(&wiphy->dev):wiphy_name(wiphy): " fmt, ##argsfor instance:
[ 41.261941] ieee80211 phy0: phy0: Selected rate control algorithm 'minstrel_ht'ie: redundant.
wiphy_name(wiphy)is an inline fordev_name(&wiphy->dev)So it's appropriate to use:
Quoted 7 lines
#define wiphy_<level>(wiphy, fmt, arg...) dev_<level>(&wiphy->dev, fmt, ##arg)
and the output becomes:
[ 41.261941] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'Signed-off-by Joe Perches <[email protected]>
Everyone OK w/ this version?
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Johannes Berg
maintainerQuoted 13 lines · John W. Linville
Quoted 13 lines
"<level>dev_driver_string(&wiphy->dev)
dev_name(&wiphy->dev):wiphy_name(wiphy): " fmt, ##argsfor instance:
[ 41.261941] ieee80211 phy0: phy0: Selected rate control algorithm 'minstrel_ht'ie: redundant.
wiphy_name(wiphy)is an inline fordev_name(&wiphy->dev)So it's appropriate to use:
#define wiphy_<level>(wiphy, fmt, arg...) dev_<level>(&wiphy->dev, fmt, ##arg)
Quoted 7 lines
Quoted 5 lines
and the output becomes:
[ 41.261941] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'Signed-off-by Joe Perches <[email protected]>Everyone OK w/ this version?
I don't care much :)
johannes