* [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper
@ 2016-05-05 7:44 Sven Eckelmann
2016-05-05 10:04 ` Antonio Quartulli
2016-05-05 10:06 ` Marek Lindner
0 siblings, 2 replies; 5+ messages in thread
From: Sven Eckelmann @ 2016-05-05 7:44 UTC (permalink / raw)
To: b.a.t.m.a.n
From: Florian Westphal <fw@strlen.de>
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>
---
Warning: untested
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 31d1df2..b349287 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);
--
2.8.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper
2016-05-05 7:44 [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper Sven Eckelmann
@ 2016-05-05 10:04 ` Antonio Quartulli
2016-05-05 10:36 ` Sven Eckelmann
2016-05-05 10:06 ` Marek Lindner
1 sibling, 1 reply; 5+ messages in thread
From: Antonio Quartulli @ 2016-05-05 10:04 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]
On Thu, May 05, 2016 at 09:44:42AM +0200, Sven Eckelmann wrote:
> From: Florian Westphal <fw@strlen.de>
>
> 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>
> ---
> Warning: untested
>
> 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)
Sven,
do we really need to rename the function is the original one does not exist in
kernels < 4.7 ? Or maybe it exists but does something else ?
Cheers,
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper
2016-05-05 10:04 ` Antonio Quartulli
@ 2016-05-05 10:36 ` Sven Eckelmann
2016-05-05 12:06 ` Antonio Quartulli
0 siblings, 1 reply; 5+ messages in thread
From: Sven Eckelmann @ 2016-05-05 10:36 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Antonio Quartulli
[-- Attachment #1: Type: text/plain, Size: 640 bytes --]
On Thursday 05 May 2016 18:04:35 Antonio Quartulli wrote:
[...]
> >
> > +#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)
>
> Sven,
>
> do we really need to rename the function is the original one does not exist
> in kernels < 4.7 ? Or maybe it exists but does something else ?
Not necessarily but Linus' noticed for a different function that some distros
(or stable maintainers) backported the function which we introduced. Thus we
used the same trick to solve the conflict.
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper
2016-05-05 10:36 ` Sven Eckelmann
@ 2016-05-05 12:06 ` Antonio Quartulli
0 siblings, 0 replies; 5+ messages in thread
From: Antonio Quartulli @ 2016-05-05 12:06 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
[-- Attachment #1: Type: text/plain, Size: 804 bytes --]
On Thu, May 05, 2016 at 12:36:54PM +0200, Sven Eckelmann wrote:
> On Thursday 05 May 2016 18:04:35 Antonio Quartulli wrote:
> [...]
> > >
> > > +#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)
> >
> > Sven,
> >
> > do we really need to rename the function is the original one does not exist
> > in kernels < 4.7 ? Or maybe it exists but does something else ?
>
> Not necessarily but Linus' noticed for a different function that some distros
> (or stable maintainers) backported the function which we introduced. Thus we
> used the same trick to solve the conflict.
Yup, thanks for reminding!
Cheers,
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper
2016-05-05 7:44 [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper Sven Eckelmann
2016-05-05 10:04 ` Antonio Quartulli
@ 2016-05-05 10:06 ` Marek Lindner
1 sibling, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2016-05-05 10:06 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Sven Eckelmann
[-- Attachment #1: Type: text/plain, Size: 646 bytes --]
On Thursday, May 05, 2016 09:44:42 Sven Eckelmann wrote:
> From: Florian Westphal <fw@strlen.de>
>
> 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>
> ---
> Warning: untested
>
> compat-include/linux/netdevice.h | 10 ++++++++++
> net/batman-adv/soft-interface.c | 2 +-
> 2 files changed, 11 insertions(+), 1 deletion(-)
Applied in revision c5ebb1b.
Thanks,
Marek
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-05-05 12:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-05 7:44 [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper Sven Eckelmann
2016-05-05 10:04 ` Antonio Quartulli
2016-05-05 10:36 ` Sven Eckelmann
2016-05-05 12:06 ` Antonio Quartulli
2016-05-05 10:06 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox