Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
commit c5ebb1bf9de9cd4420fa7df3fada088b6a590b73 Author: Florian Westphal fw@strlen.de Date: Thu May 5 09:44:42 2016 +0200
batman-adv: replace dev->trans_start update with helper
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.
Signed-off-by: Florian Westphal fw@strlen.de Signed-off-by: Sven Eckelmann sven.eckelmann@open-mesh.com Signed-off-by: Marek Lindner mareklindner@neomailbox.ch
c5ebb1bf9de9cd4420fa7df3fada088b6a590b73 compat-include/linux/netdevice.h | 10 ++++++++++ net/batman-adv/soft-interface.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h index f47f5c3..fb5b519 100644 --- a/compat-include/linux/netdevice.h +++ b/compat-include/linux/netdevice.h @@ -74,4 +74,14 @@
#endif /* < KERNEL_VERSION(4, 5, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0) + +#define netif_trans_update batadv_netif_trans_update +static inline void batadv_netif_trans_update(struct net_device *dev) +{ + dev->trans_start = jiffies; +} + +#endif /* < KERNEL_VERSION(4, 7, 0) */ + #endif /* _NET_BATMAN_ADV_COMPAT_LINUX_NETDEVICE_H_ */ diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index f37ce39..343d2c9 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -207,7 +207,7 @@ static int batadv_interface_tx(struct sk_buff *skb, if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) goto dropped;
- soft_iface->trans_start = jiffies; + netif_trans_update(soft_iface); vid = batadv_get_vid(skb, 0); ethhdr = eth_hdr(skb);