diff options
author | Joe Perches <joe@perches.com> | 2014-09-22 14:10:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-26 15:17:17 -0400 |
commit | 6ea754eb761d9e7a8ac6fa462b05f9e4cf04fb6c (patch) | |
tree | a11c449389583dee4d26215db3d362630a8af547 | |
parent | 0c87b29c3167a2cf9870e721b522651de2c72ce2 (diff) |
net: Change netdev_<level> logging functions to return void
No caller or macro uses the return value so make all
the functions return void.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/netdevice.h | 19 | ||||
-rw-r--r-- | net/core/dev.c | 44 |
2 files changed, 26 insertions, 37 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9f5d293a0281..9b7fbacb6296 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -3612,22 +3612,22 @@ static inline const char *netdev_reg_state(const struct net_device *dev) | |||
3612 | } | 3612 | } |
3613 | 3613 | ||
3614 | __printf(3, 4) | 3614 | __printf(3, 4) |
3615 | int netdev_printk(const char *level, const struct net_device *dev, | 3615 | void netdev_printk(const char *level, const struct net_device *dev, |
3616 | const char *format, ...); | 3616 | const char *format, ...); |
3617 | __printf(2, 3) | 3617 | __printf(2, 3) |
3618 | int netdev_emerg(const struct net_device *dev, const char *format, ...); | 3618 | void netdev_emerg(const struct net_device *dev, const char *format, ...); |
3619 | __printf(2, 3) | 3619 | __printf(2, 3) |
3620 | int netdev_alert(const struct net_device *dev, const char *format, ...); | 3620 | void netdev_alert(const struct net_device *dev, const char *format, ...); |
3621 | __printf(2, 3) | 3621 | __printf(2, 3) |
3622 | int netdev_crit(const struct net_device *dev, const char *format, ...); | 3622 | void netdev_crit(const struct net_device *dev, const char *format, ...); |
3623 | __printf(2, 3) | 3623 | __printf(2, 3) |
3624 | int netdev_err(const struct net_device *dev, const char *format, ...); | 3624 | void netdev_err(const struct net_device *dev, const char *format, ...); |
3625 | __printf(2, 3) | 3625 | __printf(2, 3) |
3626 | int netdev_warn(const struct net_device *dev, const char *format, ...); | 3626 | void netdev_warn(const struct net_device *dev, const char *format, ...); |
3627 | __printf(2, 3) | 3627 | __printf(2, 3) |
3628 | int netdev_notice(const struct net_device *dev, const char *format, ...); | 3628 | void netdev_notice(const struct net_device *dev, const char *format, ...); |
3629 | __printf(2, 3) | 3629 | __printf(2, 3) |
3630 | int netdev_info(const struct net_device *dev, const char *format, ...); | 3630 | void netdev_info(const struct net_device *dev, const char *format, ...); |
3631 | 3631 | ||
3632 | #define MODULE_ALIAS_NETDEV(device) \ | 3632 | #define MODULE_ALIAS_NETDEV(device) \ |
3633 | MODULE_ALIAS("netdev-" device) | 3633 | MODULE_ALIAS("netdev-" device) |
@@ -3645,7 +3645,6 @@ do { \ | |||
3645 | ({ \ | 3645 | ({ \ |
3646 | if (0) \ | 3646 | if (0) \ |
3647 | netdev_printk(KERN_DEBUG, __dev, format, ##args); \ | 3647 | netdev_printk(KERN_DEBUG, __dev, format, ##args); \ |
3648 | 0; \ | ||
3649 | }) | 3648 | }) |
3650 | #endif | 3649 | #endif |
3651 | 3650 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index e2ced01c01e4..e55c546717d4 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -7066,53 +7066,45 @@ const char *netdev_drivername(const struct net_device *dev) | |||
7066 | return empty; | 7066 | return empty; |
7067 | } | 7067 | } |
7068 | 7068 | ||
7069 | static int __netdev_printk(const char *level, const struct net_device *dev, | 7069 | static void __netdev_printk(const char *level, const struct net_device *dev, |
7070 | struct va_format *vaf) | 7070 | struct va_format *vaf) |
7071 | { | 7071 | { |
7072 | int r; | ||
7073 | |||
7074 | if (dev && dev->dev.parent) { | 7072 | if (dev && dev->dev.parent) { |
7075 | r = dev_printk_emit(level[1] - '0', | 7073 | dev_printk_emit(level[1] - '0', |
7076 | dev->dev.parent, | 7074 | dev->dev.parent, |
7077 | "%s %s %s%s: %pV", | 7075 | "%s %s %s%s: %pV", |
7078 | dev_driver_string(dev->dev.parent), | 7076 | dev_driver_string(dev->dev.parent), |
7079 | dev_name(dev->dev.parent), | 7077 | dev_name(dev->dev.parent), |
7080 | netdev_name(dev), netdev_reg_state(dev), | 7078 | netdev_name(dev), netdev_reg_state(dev), |
7081 | vaf); | 7079 | vaf); |
7082 | } else if (dev) { | 7080 | } else if (dev) { |
7083 | r = printk("%s%s%s: %pV", level, netdev_name(dev), | 7081 | printk("%s%s%s: %pV", |
7084 | netdev_reg_state(dev), vaf); | 7082 | level, netdev_name(dev), netdev_reg_state(dev), vaf); |
7085 | } else { | 7083 | } else { |
7086 | r = printk("%s(NULL net_device): %pV", level, vaf); | 7084 | printk("%s(NULL net_device): %pV", level, vaf); |
7087 | } | 7085 | } |
7088 | |||
7089 | return r; | ||
7090 | } | 7086 | } |
7091 | 7087 | ||
7092 | int netdev_printk(const char *level, const struct net_device *dev, | 7088 | void netdev_printk(const char *level, const struct net_device *dev, |
7093 | const char *format, ...) | 7089 | const char *format, ...) |
7094 | { | 7090 | { |
7095 | struct va_format vaf; | 7091 | struct va_format vaf; |
7096 | va_list args; | 7092 | va_list args; |
7097 | int r; | ||
7098 | 7093 | ||
7099 | va_start(args, format); | 7094 | va_start(args, format); |
7100 | 7095 | ||
7101 | vaf.fmt = format; | 7096 | vaf.fmt = format; |
7102 | vaf.va = &args; | 7097 | vaf.va = &args; |
7103 | 7098 | ||
7104 | r = __netdev_printk(level, dev, &vaf); | 7099 | __netdev_printk(level, dev, &vaf); |
7105 | 7100 | ||
7106 | va_end(args); | 7101 | va_end(args); |
7107 | |||
7108 | return r; | ||
7109 | } | 7102 | } |
7110 | EXPORT_SYMBOL(netdev_printk); | 7103 | EXPORT_SYMBOL(netdev_printk); |
7111 | 7104 | ||
7112 | #define define_netdev_printk_level(func, level) \ | 7105 | #define define_netdev_printk_level(func, level) \ |
7113 | int func(const struct net_device *dev, const char *fmt, ...) \ | 7106 | void func(const struct net_device *dev, const char *fmt, ...) \ |
7114 | { \ | 7107 | { \ |
7115 | int r; \ | ||
7116 | struct va_format vaf; \ | 7108 | struct va_format vaf; \ |
7117 | va_list args; \ | 7109 | va_list args; \ |
7118 | \ | 7110 | \ |
@@ -7121,11 +7113,9 @@ int func(const struct net_device *dev, const char *fmt, ...) \ | |||
7121 | vaf.fmt = fmt; \ | 7113 | vaf.fmt = fmt; \ |
7122 | vaf.va = &args; \ | 7114 | vaf.va = &args; \ |
7123 | \ | 7115 | \ |
7124 | r = __netdev_printk(level, dev, &vaf); \ | 7116 | __netdev_printk(level, dev, &vaf); \ |
7125 | \ | 7117 | \ |
7126 | va_end(args); \ | 7118 | va_end(args); \ |
7127 | \ | ||
7128 | return r; \ | ||
7129 | } \ | 7119 | } \ |
7130 | EXPORT_SYMBOL(func); | 7120 | EXPORT_SYMBOL(func); |
7131 | 7121 | ||