]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
atl1c: use net_device_stats from struct net_device
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 20 Aug 2010 02:55:16 +0000 (02:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Aug 2010 06:09:36 +0000 (23:09 -0700)
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>
drivers/net/atl1c/atl1c.h
drivers/net/atl1c/atl1c_main.c

index 52abbbdf8a08c46df73b8e83d2566fe741f8043d..ef4115b897bf8d394b85e4123ca7160c73eaf134 100644 (file)
@@ -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;
 
index c7b8ef507ebd4d71fd653240c1a1f26183c4daf1..61f1634ab3f8fbff49ef904b56b057673bdd8cfa 100644 (file)
@@ -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;
@@ -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)
@@ -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;
                }