mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d104eafa64
commit
05e0f1aada
1 changed files with 6 additions and 15 deletions
|
@ -960,11 +960,6 @@ static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
|
||||||
return 0;
|
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)
|
static void read_bulk_callback(struct urb *urb)
|
||||||
{
|
{
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
|
@ -1052,7 +1047,7 @@ static void write_bulk_callback(struct urb *urb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
netdev = tp->netdev;
|
netdev = tp->netdev;
|
||||||
stats = rtl8152_get_stats(netdev);
|
stats = &netdev->stats;
|
||||||
if (status) {
|
if (status) {
|
||||||
if (net_ratelimit())
|
if (net_ratelimit())
|
||||||
netdev_warn(netdev, "Tx status %d\n", status);
|
netdev_warn(netdev, "Tx status %d\n", status);
|
||||||
|
@ -1442,7 +1437,7 @@ static void rx_bottom(struct r8152 *tp)
|
||||||
|
|
||||||
while (urb->actual_length > len_used) {
|
while (urb->actual_length > len_used) {
|
||||||
struct net_device *netdev = tp->netdev;
|
struct net_device *netdev = tp->netdev;
|
||||||
struct net_device_stats *stats;
|
struct net_device_stats *stats = &netdev->stats;
|
||||||
unsigned int pkt_len;
|
unsigned int pkt_len;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
|
||||||
|
@ -1454,8 +1449,6 @@ static void rx_bottom(struct r8152 *tp)
|
||||||
if (urb->actual_length < len_used)
|
if (urb->actual_length < len_used)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
stats = rtl8152_get_stats(netdev);
|
|
||||||
|
|
||||||
pkt_len -= CRC_SIZE;
|
pkt_len -= CRC_SIZE;
|
||||||
rx_data += sizeof(struct rx_desc);
|
rx_data += sizeof(struct rx_desc);
|
||||||
|
|
||||||
|
@ -1504,16 +1497,14 @@ static void tx_bottom(struct r8152 *tp)
|
||||||
|
|
||||||
res = r8152_tx_agg_fill(tp, agg);
|
res = r8152_tx_agg_fill(tp, agg);
|
||||||
if (res) {
|
if (res) {
|
||||||
struct net_device_stats *stats;
|
struct net_device *netdev = tp->netdev;
|
||||||
struct net_device *netdev;
|
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
netdev = tp->netdev;
|
|
||||||
stats = rtl8152_get_stats(netdev);
|
|
||||||
|
|
||||||
if (res == -ENODEV) {
|
if (res == -ENODEV) {
|
||||||
netif_device_detach(netdev);
|
netif_device_detach(netdev);
|
||||||
} else {
|
} else {
|
||||||
|
struct net_device_stats *stats = &netdev->stats;
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
netif_warn(tp, tx_err, netdev,
|
netif_warn(tp, tx_err, netdev,
|
||||||
"failed tx_urb %d\n", res);
|
"failed tx_urb %d\n", res);
|
||||||
stats->tx_dropped += agg->skb_num;
|
stats->tx_dropped += agg->skb_num;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue