Subject: Re: [PATCH net-next 4/5] treewide: replace dev->trans_start update with helper

From: Marc Kleine-Budde <[email-masked]>
Date: Mon, 9 May 2016 09:12:51 +0200

On 05/03/2016 04:33 PM, Florian Westphal wrote:
> 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: [email-masked]
> Cc: linux-xtensa-PjhNF2WwrV/[email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: MPT-FusionLinux.pdl-dY08KVG/lbpWk0Htik3J/[email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Signed-off-by: Florian Westphal <[email-masked]>
> ---
>  Checkpatch complains about whitespace damage, but
>  this extra whitespace already exists before this patch.
> 
>  drivers/net/can/mscan/mscan.c                          | 4 ++--
>  drivers/net/can/usb/ems_usb.c                          | 4 ++--
>  drivers/net/can/usb/esd_usb2.c                         | 4 ++--
>  drivers/net/can/usb/peak_usb/pcan_usb_core.c           | 4 ++--

> diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
> index e36b740..acb708f 100644
> --- a/drivers/net/can/mscan/mscan.c
> +++ b/drivers/net/can/mscan/mscan.c
> @@ -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);
>  
> @@ -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))
> diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
> index 3400fd1..71f0e79 100644
> --- a/drivers/net/can/usb/ems_usb.c
> +++ b/drivers/net/can/usb/ems_usb.c
> @@ -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++;
> @@ -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 ||
> diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
> index 113e64f..784a900 100644
> --- a/drivers/net/can/usb/esd_usb2.c
> +++ b/drivers/net/can/usb/esd_usb2.c
> @@ -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,
> @@ -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
> diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
> index 5a2e341..bfb91d8 100644
> --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
> +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
> @@ -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:
> @@ -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)

For the drivers/can part:

Acked-by: Marc Kleine-Budde <[email-masked]>

regards,
Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |