diff options
author | Joe Perches <joe@perches.com> | 2010-06-26 21:02:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-04 13:40:18 -0400 |
commit | 256df2f3879efdb2e9808bdb1b54b16fbb11fa38 (patch) | |
tree | ec7bd8e1e6d7d7066542420641ccd68e98e42bfa /include/linux/netdevice.h | |
parent | 99bcf217183e02ebae46373896fba7f12d588001 (diff) |
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>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8fa5e5aa879a..0183901ea475 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2250,25 +2250,23 @@ static inline const char *netdev_name(const struct net_device *dev) | |||
2250 | return dev->name; | 2250 | return dev->name; |
2251 | } | 2251 | } |
2252 | 2252 | ||
2253 | #define netdev_printk(level, netdev, format, args...) \ | 2253 | extern int netdev_printk(const char *level, const struct net_device *dev, |
2254 | dev_printk(level, (netdev)->dev.parent, \ | 2254 | const char *format, ...) |
2255 | "%s: " format, \ | 2255 | __attribute__ ((format (printf, 3, 4))); |
2256 | netdev_name(netdev), ##args) | 2256 | extern int netdev_emerg(const struct net_device *dev, const char *format, ...) |
2257 | 2257 | __attribute__ ((format (printf, 2, 3))); | |
2258 | #define netdev_emerg(dev, format, args...) \ | 2258 | extern int netdev_alert(const struct net_device *dev, const char *format, ...) |
2259 | netdev_printk(KERN_EMERG, dev, format, ##args) | 2259 | __attribute__ ((format (printf, 2, 3))); |
2260 | #define netdev_alert(dev, format, args...) \ | 2260 | extern int netdev_crit(const struct net_device *dev, const char *format, ...) |
2261 | netdev_printk(KERN_ALERT, dev, format, ##args) | 2261 | __attribute__ ((format (printf, 2, 3))); |
2262 | #define netdev_crit(dev, format, args...) \ | 2262 | extern int netdev_err(const struct net_device *dev, const char *format, ...) |
2263 | netdev_printk(KERN_CRIT, dev, format, ##args) | 2263 | __attribute__ ((format (printf, 2, 3))); |
2264 | #define netdev_err(dev, format, args...) \ | 2264 | extern int netdev_warn(const struct net_device *dev, const char *format, ...) |
2265 | netdev_printk(KERN_ERR, dev, format, ##args) | 2265 | __attribute__ ((format (printf, 2, 3))); |
2266 | #define netdev_warn(dev, format, args...) \ | 2266 | extern int netdev_notice(const struct net_device *dev, const char *format, ...) |
2267 | netdev_printk(KERN_WARNING, dev, format, ##args) | 2267 | __attribute__ ((format (printf, 2, 3))); |
2268 | #define netdev_notice(dev, format, args...) \ | 2268 | extern int netdev_info(const struct net_device *dev, const char *format, ...) |
2269 | netdev_printk(KERN_NOTICE, dev, format, ##args) | 2269 | __attribute__ ((format (printf, 2, 3))); |
2270 | #define netdev_info(dev, format, args...) \ | ||
2271 | netdev_printk(KERN_INFO, dev, format, ##args) | ||
2272 | 2270 | ||
2273 | #if defined(DEBUG) | 2271 | #if defined(DEBUG) |
2274 | #define netdev_dbg(__dev, format, args...) \ | 2272 | #define netdev_dbg(__dev, format, args...) \ |