Skip to content

Commit

Permalink
atl1c: use net_device_stats from struct net_device
Browse files Browse the repository at this point in the history
struct net_device has its own struct net_device_stats member, so use
this one instead of a private copy in the atl1c_adapter struct.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Aug 22, 2010
1 parent 00959ad commit a2c483a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion drivers/net/atl1c/atl1c.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ struct atl1c_adapter {
struct napi_struct napi;
struct atl1c_hw hw;
struct atl1c_hw_stats hw_stats;
struct net_device_stats net_stats;
struct mii_if_info mii; /* MII interface info */
u16 rx_buffer_len;

Expand Down
6 changes: 3 additions & 3 deletions drivers/net/atl1c/atl1c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ static struct net_device_stats *atl1c_get_stats(struct net_device *netdev)
{
struct atl1c_adapter *adapter = netdev_priv(netdev);
struct atl1c_hw_stats *hw_stats = &adapter->hw_stats;
struct net_device_stats *net_stats = &adapter->net_stats;
struct net_device_stats *net_stats = &netdev->stats;

atl1c_update_hw_stats(adapter);
net_stats->rx_packets = hw_stats->rx_ok;
Expand Down Expand Up @@ -1590,7 +1590,7 @@ static struct net_device_stats *atl1c_get_stats(struct net_device *netdev)
net_stats->tx_aborted_errors = hw_stats->tx_abort_col;
net_stats->tx_window_errors = hw_stats->tx_late_col;

return &adapter->net_stats;
return net_stats;
}

static inline void atl1c_clear_phy_int(struct atl1c_adapter *adapter)
Expand Down Expand Up @@ -1700,7 +1700,7 @@ static irqreturn_t atl1c_intr(int irq, void *data)

/* link event */
if (status & (ISR_GPHY | ISR_MANUAL)) {
adapter->net_stats.tx_carrier_errors++;
netdev->stats.tx_carrier_errors++;
atl1c_link_chg_event(adapter);
break;
}
Expand Down

0 comments on commit a2c483a

Please sign in to comment.