Skip to content

Commit

Permalink
datapath: make ndo_get_stats64 a void function
Browse files Browse the repository at this point in the history
Upstream commit:
    commit bc1f44709cf27fb2a5766cadafe7e2ad5e9cb221
    Author: stephen hemminger <[email protected]>
    Date:   Fri Jan 6 19:12:52 2017 -0800

    net: make ndo_get_stats64 a void function

    The network device operation for reading statistics is only called
    in one place, and it ignores the return value. Having a structure
    return value is potentially confusing because some future driver could
    incorrectly assume that the return value was used.

    Fix all drivers with ndo_get_stats64 to have a void function.

    Signed-off-by: Stephen Hemminger <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

This seems to be fine for all prior Linux versions as well.

Signed-off-by: Jarno Rajahalme <[email protected]>
Signed-off-by: Joe Stringer <[email protected]>
  • Loading branch information
shemminger authored and joestringer committed Mar 3, 2017
1 parent 00179c7 commit 3c82e35
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions datapath/vport-internal_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static void internal_dev_destructor(struct net_device *dev)
free_netdev(dev);
}

static struct rtnl_link_stats64 *
static void
internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
{
int i;
Expand Down Expand Up @@ -145,8 +145,6 @@ internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
stats->tx_bytes += local_stats.tx_bytes;
stats->tx_packets += local_stats.tx_packets;
}

return stats;
}

#ifdef HAVE_IFF_PHONY_HEADROOM
Expand All @@ -164,7 +162,7 @@ static const struct net_device_ops internal_dev_netdev_ops = {
#ifndef HAVE_NET_DEVICE_WITH_MAX_MTU
.ndo_change_mtu = internal_dev_change_mtu,
#endif
.ndo_get_stats64 = internal_get_stats,
.ndo_get_stats64 = (void *)internal_get_stats,
#ifdef HAVE_IFF_PHONY_HEADROOM
#ifndef HAVE_NET_DEVICE_OPS_WITH_EXTENDED
.ndo_set_rx_headroom = internal_set_rx_headroom,
Expand Down

0 comments on commit 3c82e35

Please sign in to comment.