mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
34ac2573e8
commit
96e74088f1
2 changed files with 12 additions and 17 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue