Skip to contentSkip to conversation

batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2

PATCH Superseded Sven Eckelmann 1 participant 1 message Mar 1, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: Disable __ethtool_get_link_ksettings compat on < 3.2

The __ethtool_get_link_ksettings is currently used only for kernels >= 3.15. But the compat code is read by the compiler for each kernel. But kernels up to 3.1 never had the function __ethtool_get_settings which is used to emulate this function for kernels < 4.6. Therefore, kernels < 3.2 will fail to compile when this compatibility layer is enabled.

Fixes 3515604d82d5 ("batman-adv: ELP - use new ethtool_link_get_ksettings API")
---
 compat-include/linux/ethtool.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
compat-include/linux/ethtool.h +3 -1
index 87f7577..a24390a 100644
@@ -24,7 +24,9 @@
 #include <linux/version.h>
 #include_next <linux/ethtool.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
+/* WARNING only enabled on kernels with __ethtool_get_settings support */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
 
 #define ethtool_link_ksettings batadv_ethtool_link_ksettings
 
Signature · 1 line
2.7.0