Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d0e9657 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller
Browse files

drivers: replace dev->trans_start accesses with dev_trans_start



a trans_start struct member exists twice:
- in struct net_device (legacy)
- in struct netdev_queue

Instead of open-coding dev->trans_start usage to obtain the current
trans_start value, use dev_trans_start() instead.

This is not exactly the same, as dev_trans_start also considers
the trans_start values of the netdev queues owned by the device
and provides the most recent one.

For legacy devices this doesn't matter as dev_trans_start can cope
with netdev trans_start values of 0 (they are ignored).

This is a prerequisite to eventual removal of dev->trans_start.

Cc: linux-rdma@vger.kernel.org
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a6e5472d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1036,7 +1036,7 @@ static void ipoib_timeout(struct net_device *dev)
	struct ipoib_dev_priv *priv = netdev_priv(dev);

	ipoib_warn(priv, "transmit timeout: latency %d msecs\n",
		   jiffies_to_msecs(jiffies - dev->trans_start));
		   jiffies_to_msecs(jiffies - dev_trans_start(dev)));
	ipoib_warn(priv, "queue stopped %d, tx_head %u, tx_tail %u\n",
		   netif_queue_stopped(dev),
		   priv->tx_head, priv->tx_tail);
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ static void e1000e_dump(struct e1000_adapter *adapter)
		dev_info(&adapter->pdev->dev, "Net device Info\n");
		pr_info("Device Name     state            trans_start      last_rx\n");
		pr_info("%-15s %016lX %016lX %016lX\n", netdev->name,
			netdev->state, netdev->trans_start, netdev->last_rx);
			netdev->state, dev_trans_start(netdev), netdev->last_rx);
	}

	/* Print Registers */
+1 −1
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ static void igb_dump(struct igb_adapter *adapter)
		dev_info(&adapter->pdev->dev, "Net device Info\n");
		pr_info("Device Name     state            trans_start      last_rx\n");
		pr_info("%-15s %016lX %016lX %016lX\n", netdev->name,
			netdev->state, netdev->trans_start, netdev->last_rx);
			netdev->state, dev_trans_start(netdev), netdev->last_rx);
	}

	/* Print Registers */
+1 −1
Original line number Diff line number Diff line
@@ -608,7 +608,7 @@ static void ixgbe_dump(struct ixgbe_adapter *adapter)
		pr_info("%-15s %016lX %016lX %016lX\n",
			netdev->name,
			netdev->state,
			netdev->trans_start,
			dev_trans_start(netdev),
			netdev->last_rx);
	}

+1 −1
Original line number Diff line number Diff line
@@ -890,7 +890,7 @@ static void encx24j600_tx_timeout(struct net_device *dev)
	struct encx24j600_priv *priv = netdev_priv(dev);

	netif_err(priv, tx_err, dev, "TX timeout at %ld, latency %ld\n",
		  jiffies, jiffies - dev->trans_start);
		  jiffies, jiffies - dev_trans_start(dev));

	dev->stats.tx_errors++;
	netif_wake_queue(dev);
Loading