From 39cf9f5b470399d9f69daf0c9e91cb6970db659c Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 28 Jan 2021 21:02:56 +0100 Subject: [PATCH] batman-adv: Drop compat code for Linux < 5.4 The lowest kernel version supported by OpenWrt at the moment is Linux 5.4. It is therefore not required to have these dead code sections anymore. Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 2 +- batman-adv/src/compat-hacks.h | 100 ---------------------------------- 2 files changed, 1 insertion(+), 101 deletions(-) diff --git a/batman-adv/Makefile b/batman-adv/Makefile index 2ed9596..002a2ef 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batman-adv PKG_VERSION:=2020.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) diff --git a/batman-adv/src/compat-hacks.h b/batman-adv/src/compat-hacks.h index fec5e15..32730a3 100644 --- a/batman-adv/src/compat-hacks.h +++ b/batman-adv/src/compat-hacks.h @@ -5,106 +5,6 @@ #include /* LINUX_VERSION_CODE */ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) - -#include - -#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) ({\ - BUILD_BUG_ON(extack != NULL); \ - netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info); \ -}) - -#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 -#include_next - -static inline int batadv_ipv6_mc_check_mld1(struct sk_buff *skb) -{ - return ipv6_mc_check_mld(skb, NULL); -} - -static inline int batadv_ipv6_mc_check_mld2(struct sk_buff *skb, - struct sk_buff **skb_trimmed) -{ - return ipv6_mc_check_mld(skb, skb_trimmed); -} - -#define ipv6_mc_check_mld_get(_1, _2, ipv6_mc_check_mld_name, ...) ipv6_mc_check_mld_name -#define ipv6_mc_check_mld(...) \ - ipv6_mc_check_mld_get(__VA_ARGS__, batadv_ipv6_mc_check_mld2, batadv_ipv6_mc_check_mld1)(__VA_ARGS__) - -static inline int batadv_ip_mc_check_igmp1(struct sk_buff *skb) -{ - return ip_mc_check_igmp(skb, NULL); -} - -static inline int batadv_ip_mc_check_igmp2(struct sk_buff *skb, - struct sk_buff **skb_trimmed) -{ - return ip_mc_check_igmp(skb, skb_trimmed); -} - -#define ip_mc_check_igmp_get(_1, _2, ip_mc_check_igmp_name, ...) ip_mc_check_igmp_name -#define ip_mc_check_igmp(...) \ - ip_mc_check_igmp_get(__VA_ARGS__, batadv_ip_mc_check_igmp2, batadv_ip_mc_check_igmp1)(__VA_ARGS__) - -#endif /* < KERNEL_VERSION(5, 1, 0) */ - - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) - -#define batadv_softif_slave_add(__dev, __slave_dev, __extack) \ - batadv_softif_slave_add(__dev, __slave_dev) - -#endif /* < KERNEL_VERSION(4, 15, 0) */ - - -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) - -static inline int batadv_access_ok(int type, const void __user *p, - unsigned long size) -{ - return access_ok(type, p, size); -} - -#ifdef access_ok -#undef access_ok -#endif - -#define access_ok_get(_1, _2, _3 , access_ok_name, ...) access_ok_name -#define access_ok(...) \ - access_ok_get(__VA_ARGS__, access_ok3, access_ok2)(__VA_ARGS__) - -#define access_ok2(addr, size) batadv_access_ok(VERIFY_WRITE, (addr), (size)) -#define access_ok3(type, addr, size) batadv_access_ok((type), (addr), (size)) - -#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) */ - #if LINUX_VERSION_IS_LESS(5, 10, 0) #include