Skip to content

Commit

Permalink
treewide: replace dev->trans_start update with helper
Browse files Browse the repository at this point in the history
Replace all trans_start updates with netif_trans_update helper.
change was done via spatch:

struct net_device *d;
@@
- d->trans_start = jiffies
+ netif_trans_update(d)

Compile tested only.

Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: linux-xtensa@linux-xtensa.org
Cc: linux1394-devel@lists.sourceforge.net
Cc: linux-rdma@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-can@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-hams@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed May 4, 2016
1 parent ba162f8 commit 860e953
Show file tree
Hide file tree
Showing 156 changed files with 232 additions and 232 deletions.
4 changes: 2 additions & 2 deletions arch/um/drivers/net_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (len == skb->len) {
dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;
dev->trans_start = jiffies;
netif_trans_update(dev);
netif_start_queue(dev);

/* this is normally done in the interrupt when tx finishes */
Expand Down Expand Up @@ -252,7 +252,7 @@ static void uml_net_set_multicast_list(struct net_device *dev)

static void uml_net_tx_timeout(struct net_device *dev)
{
dev->trans_start = jiffies;
netif_trans_update(dev);
netif_wake_queue(dev);
}

Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/platforms/iss/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static int iss_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (len == skb->len) {
lp->stats.tx_packets++;
lp->stats.tx_bytes += skb->len;
dev->trans_start = jiffies;
netif_trans_update(dev);
netif_start_queue(dev);

/* this is normally done in the interrupt when tx finishes */
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3969,7 +3969,7 @@ static netdev_tx_t hdlcdev_xmit(struct sk_buff *skb,
dev_kfree_skb(skb);

/* save start time for transmit timeout detection */
dev->trans_start = jiffies;
netif_trans_update(dev);

/* start hardware transmitter if necessary */
spin_lock_irqsave(&info->lock, flags);
Expand Down Expand Up @@ -4032,7 +4032,7 @@ static int hdlcdev_open(struct net_device *dev)
tty_kref_put(tty);

/* enable network layer transmit */
dev->trans_start = jiffies;
netif_trans_update(dev);
netif_start_queue(dev);

/* inform generic HDLC layer of current DCD status */
Expand Down
2 changes: 1 addition & 1 deletion drivers/firewire/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask)

spin_unlock_irqrestore(&dev->lock, flags);

dev->netdev->trans_start = jiffies;
netif_trans_update(dev->netdev);
out:
if (free)
fwnet_free_ptask(ptask);
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/nes/nes_nic.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
nes_write32(nesdev->regs+NES_WQE_ALLOC,
(wqe_count << 24) | (1 << 23) | nesvnic->nic.qp_id);

netdev->trans_start = jiffies;
netif_trans_update(netdev);

return NETDEV_TX_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/ulp/ipoib/ipoib_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
ipoib_dma_unmap_tx(priv, tx_req);
dev_kfree_skb_any(skb);
} else {
dev->trans_start = jiffies;
netif_trans_update(dev);
++tx->tx_head;

if (++priv->tx_outstanding == ipoib_sendq_size) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
if (netif_queue_stopped(dev))
netif_wake_queue(dev);
} else {
dev->trans_start = jiffies;
netif_trans_update(dev);

address->last_send = priv->tx_head;
++priv->tx_head;
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/hysdn/hysdn_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev)
if (lp->in_idx >= MAX_SKB_BUFFERS)
lp->in_idx = 0; /* wrap around */
lp->sk_count++; /* adjust counter */
dev->trans_start = jiffies;
netif_trans_update(dev);

/* If we just used up the very last entry in the
* TX ring on this device, tell the queueing
Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/i4l/isdn_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ static void isdn_net_tx_timeout(struct net_device *ndev)
* ever called --KG
*/
}
ndev->trans_start = jiffies;
netif_trans_update(ndev);
netif_wake_queue(ndev);
}

Expand Down Expand Up @@ -1291,7 +1291,7 @@ isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
}
} else {
/* Device is connected to an ISDN channel */
ndev->trans_start = jiffies;
netif_trans_update(ndev);
if (!lp->dialstate) {
/* ISDN connection is established, try sending */
int ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/i4l/isdn_x25iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
case X25_IFACE_DATA:
if (*state == WAN_CONNECTED) {
skb_pull(skb, 1);
cprot->net_dev->trans_start = jiffies;
netif_trans_update(cprot->net_dev);
ret = (cprot->dops->data_req(cprot, skb));
/* prepare for future retransmissions */
if (ret) skb_push(skb, 1);
Expand Down
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
pSimple->Address.High = 0;

mpt_put_msg_frame (LanCtx, mpt_dev, mf);
dev->trans_start = jiffies;
netif_trans_update(dev);

dioprintk((KERN_INFO MYNAM ": %s/%s: Sending packet. FlagsLength = %08x.\n",
IOC_AND_NETDEV_NAMES_s_s(dev),
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/appletalk/cops.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ static void cops_timeout(struct net_device *dev)
}
printk(KERN_WARNING "%s: Transmit timed out.\n", dev->name);
cops_jumpstart(dev); /* Restart the card. */
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
netif_wake_queue(dev);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/can/mscan/mscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev)
out_8(&regs->cantflg, 1 << buf_id);

if (!test_bit(F_TX_PROGRESS, &priv->flags))
dev->trans_start = jiffies;
netif_trans_update(dev);

list_add_tail(&priv->tx_queue[buf_id].list, &priv->tx_head);

Expand Down Expand Up @@ -469,7 +469,7 @@ static irqreturn_t mscan_isr(int irq, void *dev_id)
clear_bit(F_TX_PROGRESS, &priv->flags);
priv->cur_pri = 0;
} else {
dev->trans_start = jiffies;
netif_trans_update(dev);
}

if (!test_bit(F_TX_WAIT_ALL, &priv->flags))
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/can/usb/ems_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ static void ems_usb_write_bulk_callback(struct urb *urb)
if (urb->status)
netdev_info(netdev, "Tx URB aborted (%d)\n", urb->status);

netdev->trans_start = jiffies;
netif_trans_update(netdev);

/* transmission complete interrupt */
netdev->stats.tx_packets++;
Expand Down Expand Up @@ -835,7 +835,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
stats->tx_dropped++;
}
} else {
netdev->trans_start = jiffies;
netif_trans_update(netdev);

/* Slow down tx path */
if (atomic_read(&dev->active_tx_urbs) >= MAX_TX_URBS ||
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/can/usb/esd_usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ static void esd_usb2_write_bulk_callback(struct urb *urb)
if (urb->status)
netdev_info(netdev, "Tx URB aborted (%d)\n", urb->status);

netdev->trans_start = jiffies;
netif_trans_update(netdev);
}

static ssize_t show_firmware(struct device *d,
Expand Down Expand Up @@ -820,7 +820,7 @@ static netdev_tx_t esd_usb2_start_xmit(struct sk_buff *skb,
goto releasebuf;
}

netdev->trans_start = jiffies;
netif_trans_update(netdev);

/*
* Release our reference to this URB, the USB core will eventually free
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/can/usb/peak_usb/pcan_usb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
netdev->stats.tx_bytes += context->data_len;

/* prevent tx timeout */
netdev->trans_start = jiffies;
netif_trans_update(netdev);
break;

default:
Expand Down Expand Up @@ -373,7 +373,7 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
stats->tx_dropped++;
}
} else {
netdev->trans_start = jiffies;
netif_trans_update(netdev);

/* slow down tx path */
if (atomic_read(&dev->active_tx_urbs) >= PCAN_USB_MAX_TX_URBS)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cris/eth_v10.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ e100_send_packet(struct sk_buff *skb, struct net_device *dev)

myNextTxDesc->skb = skb;

dev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
netif_trans_update(dev); /* NETIF_F_LLTX driver :( */

e100_hardware_send_packet(np, buf, skb->len);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/3com/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ el3_tx_timeout (struct net_device *dev)
dev->name, inb(ioaddr + TX_STATUS), inw(ioaddr + EL3_STATUS),
inw(ioaddr + TX_FREE));
dev->stats.tx_errors++;
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
/* Issue TX_RESET and TX_START commands. */
outw(TxReset, ioaddr + EL3_CMD);
outw(TxEnable, ioaddr + EL3_CMD);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/3com/3c515.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ static void corkscrew_timeout(struct net_device *dev)
if (!(inw(ioaddr + EL3_STATUS) & CmdInProgress))
break;
outw(TxEnable, ioaddr + EL3_CMD);
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
dev->stats.tx_errors++;
dev->stats.tx_dropped++;
netif_wake_queue(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/3com/3c574_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ static void el3_tx_timeout(struct net_device *dev)
netdev_notice(dev, "Transmit timed out!\n");
dump_status(dev);
dev->stats.tx_errors++;
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
/* Issue TX_RESET and TX_START commands. */
tc574_wait_for_completion(dev, TxReset);
outw(TxEnable, ioaddr + EL3_CMD);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/3com/3c589_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ static void el3_tx_timeout(struct net_device *dev)
netdev_warn(dev, "Transmit timed out!\n");
dump_status(dev);
dev->stats.tx_errors++;
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
/* Issue TX_RESET and TX_START commands. */
tc589_wait_for_completion(dev, TxReset);
outw(TxEnable, ioaddr + EL3_CMD);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/3com/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,7 @@ static void vortex_tx_timeout(struct net_device *dev)
}
/* Issue Tx Enable */
iowrite16(TxEnable, ioaddr + EL3_CMD);
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
}

/*
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/8390/axnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb,
{
ei_local->txing = 1;
NS8390_trigger_send(dev, send_length, output_page);
dev->trans_start = jiffies;
netif_trans_update(dev);
if (output_page == ei_local->tx_start_page)
{
ei_local->tx1 = -1;
Expand Down Expand Up @@ -1270,7 +1270,7 @@ static void ei_tx_intr(struct net_device *dev)
{
ei_local->txing = 1;
NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6);
dev->trans_start = jiffies;
netif_trans_update(dev);
ei_local->tx2 = -1,
ei_local->lasttx = 2;
}
Expand All @@ -1287,7 +1287,7 @@ static void ei_tx_intr(struct net_device *dev)
{
ei_local->txing = 1;
NS8390_trigger_send(dev, ei_local->tx1, ei_local->tx_start_page);
dev->trans_start = jiffies;
netif_trans_update(dev);
ei_local->tx1 = -1;
ei_local->lasttx = 1;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/8390/lib8390.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ static void ei_tx_intr(struct net_device *dev)
if (ei_local->tx2 > 0) {
ei_local->txing = 1;
NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6);
dev->trans_start = jiffies;
netif_trans_update(dev);
ei_local->tx2 = -1,
ei_local->lasttx = 2;
} else
Expand All @@ -609,7 +609,7 @@ static void ei_tx_intr(struct net_device *dev)
if (ei_local->tx1 > 0) {
ei_local->txing = 1;
NS8390_trigger_send(dev, ei_local->tx1, ei_local->tx_start_page);
dev->trans_start = jiffies;
netif_trans_update(dev);
ei_local->tx1 = -1;
ei_local->lasttx = 1;
} else
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/adaptec/starfire.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ static void tx_timeout(struct net_device *dev)

/* Trigger an immediate transmit demand. */

dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
dev->stats.tx_errors++;
netif_wake_queue(dev);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/adi/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ static void bfin_mac_timeout(struct net_device *dev)
bfin_mac_enable(lp->phydev);

/* We can accept TX packets again */
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
}

static void bfin_mac_multicast_hash(struct net_device *dev)
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/agere/et131x.c
Original file line number Diff line number Diff line change
Expand Up @@ -3349,7 +3349,7 @@ static void et131x_down(struct net_device *netdev)
struct et131x_adapter *adapter = netdev_priv(netdev);

/* Save the timestamp for the TX watchdog, prevent a timeout */
netdev->trans_start = jiffies;
netif_trans_update(netdev);

phy_stop(adapter->phydev);
et131x_disable_txrx(netdev);
Expand Down Expand Up @@ -3816,7 +3816,7 @@ static netdev_tx_t et131x_tx(struct sk_buff *skb, struct net_device *netdev)
netif_stop_queue(netdev);

/* Save the timestamp for the TX timeout watchdog */
netdev->trans_start = jiffies;
netif_trans_update(netdev);

/* TCB is not available */
if (tx_ring->used >= NUM_TCB)
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/allwinner/sun4i-emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static void emac_timeout(struct net_device *dev)
emac_reset(db);
emac_init_device(dev);
/* We can accept TX packets again */
dev->trans_start = jiffies;
netif_trans_update(dev);
netif_wake_queue(dev);

/* Restore previous register address */
Expand Down Expand Up @@ -468,7 +468,7 @@ static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev)
db->membase + EMAC_TX_CTL0_REG);

/* save the time stamp */
dev->trans_start = jiffies;
netif_trans_update(dev);
} else if (channel == 1) {
/* set TX len */
writel(skb->len, db->membase + EMAC_TX_PL1_REG);
Expand All @@ -477,7 +477,7 @@ static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev)
db->membase + EMAC_TX_CTL1_REG);

/* save the time stamp */
dev->trans_start = jiffies;
netif_trans_update(dev);
}

if ((db->tx_fifo_stat & 3) == 3) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/amd/7990.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static int lance_reset(struct net_device *dev)

load_csrs(lp);
lance_init_ring(dev);
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
status = init_restart_lance(lp);
#ifdef DEBUG_DRIVER
printk("Lance restart=%d\n", status);
Expand Down Expand Up @@ -530,7 +530,7 @@ void lance_tx_timeout(struct net_device *dev)
{
printk("lance_tx_timeout\n");
lance_reset(dev);
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
netif_wake_queue(dev);
}
EXPORT_SYMBOL_GPL(lance_tx_timeout);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/amd/a2065.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static inline int lance_reset(struct net_device *dev)
load_csrs(lp);

lance_init_ring(dev);
dev->trans_start = jiffies; /* prevent tx timeout */
netif_trans_update(dev); /* prevent tx timeout */
netif_start_queue(dev);

status = init_restart_lance(lp);
Expand Down
Loading

0 comments on commit 860e953

Please sign in to comment.