Skip to content

Commit

Permalink
ehea: Remove unnecessary memset of stats in netdev private data
Browse files Browse the repository at this point in the history
The memory for netdev private data is allocated using kzalloc/vzalloc in
alloc_netdev_mqs, thus there is no need to zero the stats portion of it
again in the driver's probe function.

In any case, the size for the memset is wrong as the stats member is of
type rtnl_link_stats64, not net_device_stats.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
tklauser authored and davem330 committed Nov 30, 2016
1 parent b634d30 commit f54b8cd
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/net/ethernet/ibm/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3044,7 +3044,6 @@ static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
init_waitqueue_head(&port->swqe_avail_wq);
init_waitqueue_head(&port->restart_wq);

memset(&port->stats, 0, sizeof(struct net_device_stats));
ret = register_netdev(dev);
if (ret) {
pr_err("register_netdev failed. ret=%d\n", ret);
Expand Down

0 comments on commit f54b8cd

Please sign in to comment.