[RFC] batman-adv: Drop support for Linux < 4.19

Message ID 20231104-drop-compat-4-14-v1-1-d2453b1cfd45@narfation.org (mailing list archive)
State RFC, archived
Delegated to: Simon Wunderlich
Headers
Series [RFC] batman-adv: Drop support for Linux < 4.19 |

Commit Message

Sven Eckelmann Nov. 4, 2023, 4:10 p.m. UTC
  The Linux Kernel 4.14 reached its end of life [1] after 6 years. Instead it
is recommended to use at least kernel 4.19. It is also over 5 years
old but still maintained by the stable kernel team. All older kernels
(4.14 - v4.18) will be dropped to reduce the support overhead.

[1] TODO: https://lore.kernel.org/r/

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
The last 4.14 version was not yet released but is announced to be in Jan,
2024: https://kernel.org/category/releases.html
---
 README.external.rst              |  2 +-
 compat-include/linux/netdevice.h |  8 --------
 compat-include/linux/stddef.h    | 24 ------------------------
 compat-include/net/cfg80211.h    | 40 ----------------------------------------
 compat-include/net/genetlink.h   | 18 ------------------
 compat.h                         |  7 -------
 6 files changed, 1 insertion(+), 98 deletions(-)


---
base-commit: 5fecd4a389cea1b9719e9ec480d7257887e0dfdf
change-id: 20231104-drop-compat-4-14-1bba04bac963

Best regards,
  

Patch

diff --git a/README.external.rst b/README.external.rst
index 58e8fc7a..62a8cf06 100644
--- a/README.external.rst
+++ b/README.external.rst
@@ -12,7 +12,7 @@  and as an external module. The external  module   allows  to  get
 new    features without  upgrading  to  a  newer  kernel  version
 and to get batman-adv specific bug fixes for  kernels  that   are
 not   supported   anymore.  It compiles  against  and should work
-with  Linux 4.14  -  6.5.  Supporting  older  versions   is   not
+with  Linux 4.19  -  6.5.  Supporting  older  versions   is   not
 planned,  but it's probably easy to backport it. If you work on a
 backport, feel free to contact us.  :-)
 
diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h
index 3188ad3d..a489ac9b 100644
--- a/compat-include/linux/netdevice.h
+++ b/compat-include/linux/netdevice.h
@@ -13,14 +13,6 @@ 
 #include <linux/version.h>
 #include_next <linux/netdevice.h>
 
-#if LINUX_VERSION_IS_LESS(4, 15, 0)
-
-#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) \
-	netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info)
-
-#endif /* LINUX_VERSION_IS_LESS(4, 15, 0) */
-
-
 #if LINUX_VERSION_IS_LESS(5, 15, 0)
 
 static inline void batadv_dev_put(struct net_device *dev)
diff --git a/compat-include/linux/stddef.h b/compat-include/linux/stddef.h
deleted file mode 100644
index c4558f81..00000000
--- a/compat-include/linux/stddef.h
+++ /dev/null
@@ -1,24 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_STDDEF_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_STDDEF_H_
-
-#include <linux/version.h>
-#include_next <linux/stddef.h>
-
-#if LINUX_VERSION_IS_LESS(4, 16, 0)
-
-#ifndef sizeof_field
-#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
-#endif
-
-#endif /* LINUX_VERSION_IS_LESS(4, 16, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_STDDEF_H_ */
diff --git a/compat-include/net/cfg80211.h b/compat-include/net/cfg80211.h
deleted file mode 100644
index 4bfcd5a3..00000000
--- a/compat-include/net/cfg80211.h
+++ /dev/null
@@ -1,40 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_NET_CFG80211_H_
-#define _NET_BATMAN_ADV_COMPAT_NET_CFG80211_H_
-
-#include <linux/version.h>
-#include_next <net/cfg80211.h>
-
-
-#if LINUX_VERSION_IS_LESS(4, 18, 0) && IS_ENABLED(CONFIG_CFG80211)
-
-/* cfg80211 fix: https://patchwork.kernel.org/patch/10449857/ */
-static inline int batadv_cfg80211_get_station(struct net_device *dev,
-					      const u8 *mac_addr,
-					      struct station_info *sinfo)
-{
-	memset(sinfo, 0, sizeof(*sinfo));
-	return cfg80211_get_station(dev, mac_addr, sinfo);
-}
-
-#define cfg80211_get_station(dev, mac_addr, sinfo) \
-	batadv_cfg80211_get_station(dev, mac_addr, sinfo)
-
-#endif /* LINUX_VERSION_IS_LESS(4, 18, 0) && IS_ENABLED(CONFIG_CFG80211) */
-
-
-#if LINUX_VERSION_IS_LESS(4, 18, 0)
-
-#define cfg80211_sinfo_release_content(sinfo)
-
-#endif /* LINUX_VERSION_IS_LESS(4, 18, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_NET_CFG80211_H_ */
diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h
index 05c57ce0..85376044 100644
--- a/compat-include/net/genetlink.h
+++ b/compat-include/net/genetlink.h
@@ -13,24 +13,6 @@ 
 #include <linux/version.h>
 #include_next <net/genetlink.h>
 
-#if LINUX_VERSION_IS_LESS(4, 15, 0)
-
-static inline
-void batadv_genl_dump_check_consistent(struct netlink_callback *cb,
-				       void *user_hdr)
-{
-	struct genl_family genl_family = {
-		.hdrsize = 0,
-	};
-
-	genl_dump_check_consistent(cb, user_hdr, &genl_family);
-}
-
-#define genl_dump_check_consistent batadv_genl_dump_check_consistent
-
-#endif /* LINUX_VERSION_IS_LESS(4, 15, 0) */
-
-
 #if LINUX_VERSION_IS_LESS(5, 10, 0)
 
 #if LINUX_VERSION_IS_LESS(5, 2, 0)
diff --git a/compat.h b/compat.h
index 8e19f9bb..638bfc54 100644
--- a/compat.h
+++ b/compat.h
@@ -16,13 +16,6 @@ 
 #include "compat-autoconf.h"
 
 
-#if LINUX_VERSION_IS_LESS(4, 15, 0)
-
-#define batadv_softif_slave_add(__dev, __slave_dev, __extack) \
-	batadv_softif_slave_add(__dev, __slave_dev)
-
-#endif /* LINUX_VERSION_IS_LESS(4, 15, 0) */
-
 #endif /* __KERNEL__ */
 
 #endif /* _NET_BATMAN_ADV_COMPAT_H_ */