Repository : ssh://git@diktynna/openwrt-feed-devel
On branch : master
commit 836c8f3ad005d5a0b4d46a4215c3b58ebee039b0 Author: Sven Eckelmann sven@narfation.org Date: Fri Mar 6 21:26:47 2020 +0100
batman-adv-devel: Refresh compat-hacks for current OpenWrt
Signed-off-by: Sven Eckelmann sven@narfation.org
836c8f3ad005d5a0b4d46a4215c3b58ebee039b0 batman-adv-devel/src/compat-hacks.h | 55 ++++++++++++++----------------------- 1 file changed, 21 insertions(+), 34 deletions(-)
diff --git a/batman-adv-devel/src/compat-hacks.h b/batman-adv-devel/src/compat-hacks.h index 9dd4597..b57f7b6 100644 --- a/batman-adv-devel/src/compat-hacks.h +++ b/batman-adv-devel/src/compat-hacks.h @@ -17,6 +17,15 @@ #endif /* < KERNEL_VERSION(4, 15, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) + +#ifndef sizeof_field +#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) +#endif + +#endif /* < KERNEL_VERSION(4, 16, 0) */ + + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
#include_next <linux/igmp.h> @@ -55,40 +64,6 @@ static inline int batadv_ip_mc_check_igmp2(struct sk_buff *skb, #endif /* < KERNEL_VERSION(5, 1, 0) */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) - -#include_next <linux/cache.h> - -/* hack for netlink.c which marked the family ops as ro */ -#ifdef __ro_after_init -#undef __ro_after_init -#endif -#define __ro_after_init - -#endif /* < KERNEL_VERSION(4, 10, 0) */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 9) - -#include <linux/netdevice.h> - -/* work around missing attribute needs_free_netdev and priv_destructor in - * net_device - */ -#define ether_setup(dev) \ - void batadv_softif_free2(struct net_device *dev) \ - { \ - batadv_softif_free(dev); \ - free_netdev(dev); \ - } \ - void (*t1)(struct net_device *dev) __attribute__((unused)); \ - bool t2 __attribute__((unused)); \ - ether_setup(dev) -#define needs_free_netdev destructor = batadv_softif_free2; t2 -#define priv_destructor destructor = batadv_softif_free2; t1 - -#endif /* < KERNEL_VERSION(4, 11, 9) */ - - #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
#define batadv_softif_slave_add(__dev, __slave_dev, __extack) \ @@ -118,6 +93,18 @@ static inline int batadv_access_ok(int type, const void __user *p,
#endif /* < KERNEL_VERSION(5, 0, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) + +#ifndef fallthrough +#if __GNUC__ > 7 && !defined(__CHECKER__) +# define fallthrough __attribute__((__fallthrough__)) +#else +# define fallthrough do {} while (0) /* fallthrough */ +#endif +#endif + +#endif /* < KERNEL_VERSION(5, 4, 0) */ + /* <DECLARE_EWMA> */
#include <linux/version.h>