Skip to content

Commit ff458f6

Browse files
tklauserdavem330
authored andcommitted
arc_emac: Use net_device_stats from struct net_device
Instead of using a private copy of struct net_device_stats in struct arc_emac_priv, use stats from struct net_device. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 21621e9 commit ff458f6

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

‎drivers/net/ethernet/arc/emac.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ struct buffer_state {
110110
* @bus: Pointer to the current MII bus.
111111
* @regs: Base address of EMAC memory-mapped control registers.
112112
* @napi: Structure for NAPI.
113-
* @stats: Network device statistics.
114113
* @rxbd: Pointer to Rx BD ring.
115114
* @txbd: Pointer to Tx BD ring.
116115
* @rxbd_dma: DMA handle for Rx BD ring.
@@ -135,7 +134,6 @@ struct arc_emac_priv {
135134
struct clk *clk;
136135

137136
struct napi_struct napi;
138-
struct net_device_stats stats;
139137

140138
struct arc_emac_bd *rxbd;
141139
struct arc_emac_bd *txbd;

‎drivers/net/ethernet/arc/emac_main.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static const struct ethtool_ops arc_emac_ethtool_ops = {
140140
static void arc_emac_tx_clean(struct net_device *ndev)
141141
{
142142
struct arc_emac_priv *priv = netdev_priv(ndev);
143-
struct net_device_stats *stats = &priv->stats;
143+
struct net_device_stats *stats = &ndev->stats;
144144
unsigned int i;
145145

146146
for (i = 0; i < TX_BD_NUM; i++) {
@@ -202,7 +202,7 @@ static int arc_emac_rx(struct net_device *ndev, int budget)
202202

203203
for (work_done = 0; work_done < budget; work_done++) {
204204
unsigned int *last_rx_bd = &priv->last_rx_bd;
205-
struct net_device_stats *stats = &priv->stats;
205+
struct net_device_stats *stats = &ndev->stats;
206206
struct buffer_state *rx_buff = &priv->rx_buff[*last_rx_bd];
207207
struct arc_emac_bd *rxbd = &priv->rxbd[*last_rx_bd];
208208
unsigned int pktlen, info = le32_to_cpu(rxbd->info);
@@ -318,7 +318,7 @@ static irqreturn_t arc_emac_intr(int irq, void *dev_instance)
318318
{
319319
struct net_device *ndev = dev_instance;
320320
struct arc_emac_priv *priv = netdev_priv(ndev);
321-
struct net_device_stats *stats = &priv->stats;
321+
struct net_device_stats *stats = &ndev->stats;
322322
unsigned int status;
323323

324324
status = arc_reg_get(priv, R_STATUS);
@@ -529,7 +529,7 @@ static int arc_emac_stop(struct net_device *ndev)
529529
static struct net_device_stats *arc_emac_stats(struct net_device *ndev)
530530
{
531531
struct arc_emac_priv *priv = netdev_priv(ndev);
532-
struct net_device_stats *stats = &priv->stats;
532+
struct net_device_stats *stats = &ndev->stats;
533533
unsigned long miss, rxerr;
534534
u8 rxcrc, rxfram, rxoflow;
535535

@@ -565,7 +565,7 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)
565565
{
566566
struct arc_emac_priv *priv = netdev_priv(ndev);
567567
unsigned int len, *txbd_curr = &priv->txbd_curr;
568-
struct net_device_stats *stats = &priv->stats;
568+
struct net_device_stats *stats = &ndev->stats;
569569
__le32 *info = &priv->txbd[*txbd_curr].info;
570570
dma_addr_t addr;
571571

0 commit comments

Comments
 (0)