The following commit has been merged in the master branch: commit f379f93aef18d6f2cfc0342e3ee77ef630e6e346 Author: Sven Eckelmann sven@narfation.org Date: Fri Dec 23 22:38:01 2011 +0100
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.
Signed-off-by: Sven Eckelmann sven@narfation.org
diff --git a/compat.h b/compat.h index 3733f68..c71d928 100644 --- a/compat.h +++ b/compat.h @@ -42,6 +42,7 @@
#endif /* < KERNEL_VERSION(2, 6, 33) */
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
#define hlist_first_rcu(head) (*((struct hlist_node **)(&(head)->first))) @@ -56,6 +57,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 +92,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 +106,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 @@ -98,6 +114,7 @@ static inline int __param_set_copystring(const char *val,
#endif /* < KERNEL_VERSION(2, 6, 39) */
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, free_rcu_##ptr)