Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: nlmon: Simplify nlmon_get_stats64

Do not set rtnl_link_stats64 fields to zero, since they are zeroed
before ops->ndo_get_stats64 is called in core dev_get_stats() function.

Also, simplify the data collection by removing the temporary variable.

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Breno Leitao and committed by
David S. Miller
26b5df99 4f41ce81

+1 -9
+1 -9
drivers/net/nlmon.c
··· 40 40 static void 41 41 nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) 42 42 { 43 - u64 packets, bytes; 44 - 45 - dev_lstats_read(dev, &packets, &bytes); 46 - 47 - stats->rx_packets = packets; 48 - stats->tx_packets = 0; 49 - 50 - stats->rx_bytes = bytes; 51 - stats->tx_bytes = 0; 43 + dev_lstats_read(dev, &stats->rx_packets, &stats->rx_bytes); 52 44 } 53 45 54 46 static u32 always_on(struct net_device *dev)