summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-03-06 15:07:18 +0800
committerSeema Khowala <seemaj@nvidia.com>2014-04-23 14:07:34 -0700
commit8e1f381d6e9f77d46f85859d778a0ddbed82d95b (patch)
treed0c017e575595deb77c47631791746751aad2b00 /drivers/net
parent78e05557d5e8732a7d376ee8e43654f83400141f (diff)
r8152: remove rtl8152_get_stats
The rtl8152_get_stats() returns the point address of the struct net_device_stats. This could be got from struct net_device directly. Change-Id: Icfd675c4b637497a5f20700041a064a81a351a46 Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Aly Hirani <ahirani@nvidia.com> Reviewed-on: http://git-master/r/390291 (cherry picked from commit 1e474e3346d583776f18abc9590d99ef55f1f84d) Reviewed-on: http://git-master/r/396893 Reviewed-by: Preetham Chandru <pchandru@nvidia.com> Tested-by: Preetham Chandru <pchandru@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/usb/r8152.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 8a2e69cd66cd..fda18fb9ddf3 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -958,11 +958,6 @@ static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
return 0;
}
-static struct net_device_stats *rtl8152_get_stats(struct net_device *dev)
-{
- return &dev->stats;
-}
-
static void read_bulk_callback(struct urb *urb)
{
struct net_device *netdev;
@@ -1050,7 +1045,7 @@ static void write_bulk_callback(struct urb *urb)
return;
netdev = tp->netdev;
- stats = rtl8152_get_stats(netdev);
+ stats = &netdev->stats;
if (status) {
if (net_ratelimit())
netdev_warn(netdev, "Tx status %d\n", status);
@@ -1440,7 +1435,7 @@ static void rx_bottom(struct r8152 *tp)
while (urb->actual_length > len_used) {
struct net_device *netdev = tp->netdev;
- struct net_device_stats *stats;
+ struct net_device_stats *stats = &netdev->stats;
unsigned int pkt_len;
struct sk_buff *skb;
@@ -1452,8 +1447,6 @@ static void rx_bottom(struct r8152 *tp)
if (urb->actual_length < len_used)
break;
- stats = rtl8152_get_stats(netdev);
-
pkt_len -= CRC_SIZE;
rx_data += sizeof(struct rx_desc);
@@ -1502,16 +1495,14 @@ static void tx_bottom(struct r8152 *tp)
res = r8152_tx_agg_fill(tp, agg);
if (res) {
- struct net_device_stats *stats;
- struct net_device *netdev;
- unsigned long flags;
-
- netdev = tp->netdev;
- stats = rtl8152_get_stats(netdev);
+ struct net_device *netdev = tp->netdev;
if (res == -ENODEV) {
netif_device_detach(netdev);
} else {
+ struct net_device_stats *stats = &netdev->stats;
+ unsigned long flags;
+
netif_warn(tp, tx_err, netdev,
"failed tx_urb %d\n", res);
stats->tx_dropped += agg->skb_num;