diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-05-21 21:12:46 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-21 21:12:46 (GMT) |
commit | 96e74088f1da4d9a53735a4a57a4f984f86b75c6 (patch) | |
tree | 4c645107e3b75694ac142b562e221a868d3ccb89 /net/core/net-sysfs.c | |
parent | 34ac2573e88c4f80fc5e219d8012ea383a788803 (diff) | |
download | linux-fsl-qoriq-96e74088f1da4d9a53735a4a57a4f984f86b75c6.tar.xz |
net: The dev->get_stats pointer is not NULL nowadays.
And so does the pointer is returns, but sysfs and netlinks still
check for both cases.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r-- | net/core/net-sysfs.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 90e2177..dccd737 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -242,11 +242,11 @@ static ssize_t netstat_show(const struct device *d, offset % sizeof(unsigned long) != 0); read_lock(&dev_base_lock); - if (dev_isalive(dev) && dev->get_stats && - (stats = (*dev->get_stats)(dev))) + if (dev_isalive(dev)) { + stats = dev->get_stats(dev); ret = sprintf(buf, fmt_ulong, *(unsigned long *)(((u8 *) stats) + offset)); - + } read_unlock(&dev_base_lock); return ret; } @@ -457,8 +457,7 @@ int netdev_register_kobject(struct net_device *net) strlcpy(dev->bus_id, net->name, BUS_ID_SIZE); #ifdef CONFIG_SYSFS - if (net->get_stats) - *groups++ = &netstat_group; + *groups++ = &netstat_group; #ifdef CONFIG_WIRELESS_EXT if (net->wireless_handlers && net->wireless_handlers->get_wireless_stats) |