Skip to contentSkip to conversation

batman-adv: Fix compilation with linux 2.6.29 and 2.6.30

PATCH Applied Sven Eckelmann 2 participants 2 messages Dec 23, 2011 – Dec 24, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: Fix compilation with linux 2.6.29 and 2.6.30

Linux v2.6.30-2332-gfddd520 introduced a seventh parameter to __module_param_call. It is used to give a slightly different user experience for bool parameters. Older kernels can just drop this information using a special compat wrapper for __module_param_call.

---
 compat.h |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)
compat.h +19 -4
index 3733f68..eb7ab50 100644
@@ -56,6 +56,20 @@
 
 #endif /* < KERNEL_VERSION(2, 6, 34) */
 
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
+
+#define __compat__module_param_call(p1, p2, p3, p4, p5, p6, p7) \
+	__module_param_call(p1, p2, p3, p4, p5, p7)
+
+#else
+
+#define __compat__module_param_call(p1, p2, p3, p4, p5, p6, p7) \
+	__module_param_call(p1, p2, p3, p4, p5, p6, p7)
+
+#endif /* < KERNEL_VERSION(2, 6, 31) */
+
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
 
 #define __rcu
@@ -77,10 +91,10 @@ struct kernel_param_ops {
 	static int __compat_get_param_##name(char *buffer,		\
 					     struct kernel_param *kp)	\
 				{ return (ops)->get(buffer, kp); }	\
-	__module_param_call(MODULE_PARAM_PREFIX, name,			\
-			    __compat_set_param_##name,			\
-			    __compat_get_param_##name, arg,		\
-			    __same_type((arg), bool *), perm)
+	__compat__module_param_call(MODULE_PARAM_PREFIX, name,		\
+				    __compat_set_param_##name,		\
+				    __compat_get_param_##name, arg,	\
+				    __same_type((arg), bool *), perm)
 
 static inline int __param_set_copystring(const char *val,
 					 const struct kernel_param *kp)
@@ -91,6 +105,7 @@ static inline int __param_set_copystring(const char *val,
 
 #endif /* < KERNEL_VERSION(2, 6, 36) */
 
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
 
 #define kstrtoul strict_strtoul
Signature · 1 line
1.7.7.3
#1 lore raw
Quoted 4 lines · On Saturday, December 24, 2011 05:38:01 Sven Eckelmann wrote:

Linux v2.6.30-2332-gfddd520 introduced a seventh parameter to __module_param_call. It is used to give a slightly different user experience for bool parameters. Older kernels can just drop this information using a special compat wrapper for __module_param_call.

Applied in revision f379f93.

Thanks,
Marek