mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
netdevice.h net/core/dev.c: Convert netdev_<level> logging macros to functions
Reduces an x86 defconfig text and data ~2k. text is smaller, data is larger. $ size vmlinux* text data bss dec hex filename 7198862 720112 1366288 9285262 8dae8e vmlinux 7205273 716016 1366288 9287577 8db799 vmlinux.device_h Uses %pV and struct va_format Format arguments are verified before printk Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
99bcf21718
commit
256df2f387
2 changed files with 79 additions and 19 deletions
|
@ -2250,25 +2250,23 @@ static inline const char *netdev_name(const struct net_device *dev)
|
|||
return dev->name;
|
||||
}
|
||||
|
||||
#define netdev_printk(level, netdev, format, args...) \
|
||||
dev_printk(level, (netdev)->dev.parent, \
|
||||
"%s: " format, \
|
||||
netdev_name(netdev), ##args)
|
||||
|
||||
#define netdev_emerg(dev, format, args...) \
|
||||
netdev_printk(KERN_EMERG, dev, format, ##args)
|
||||
#define netdev_alert(dev, format, args...) \
|
||||
netdev_printk(KERN_ALERT, dev, format, ##args)
|
||||
#define netdev_crit(dev, format, args...) \
|
||||
netdev_printk(KERN_CRIT, dev, format, ##args)
|
||||
#define netdev_err(dev, format, args...) \
|
||||
netdev_printk(KERN_ERR, dev, format, ##args)
|
||||
#define netdev_warn(dev, format, args...) \
|
||||
netdev_printk(KERN_WARNING, dev, format, ##args)
|
||||
#define netdev_notice(dev, format, args...) \
|
||||
netdev_printk(KERN_NOTICE, dev, format, ##args)
|
||||
#define netdev_info(dev, format, args...) \
|
||||
netdev_printk(KERN_INFO, dev, format, ##args)
|
||||
extern int netdev_printk(const char *level, const struct net_device *dev,
|
||||
const char *format, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern int netdev_emerg(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_alert(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_crit(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_err(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_warn(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_notice(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_info(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
#if defined(DEBUG)
|
||||
#define netdev_dbg(__dev, format, args...) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue