* [B.A.T.M.A.N.] [PATCH] batman-adv: Fix compilation with linux 2.6.29 and 2.6.30
@ 2011-12-23 21:38 Sven Eckelmann
2011-12-24 14:11 ` Marek Lindner
0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2011-12-23 21:38 UTC (permalink / raw)
To: b.a.t.m.a.n
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>
---
compat.h | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/compat.h b/compat.h
index 3733f68..eb7ab50 100644
--- a/compat.h
+++ b/compat.h
@@ -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
--
1.7.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix compilation with linux 2.6.29 and 2.6.30
2011-12-23 21:38 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix compilation with linux 2.6.29 and 2.6.30 Sven Eckelmann
@ 2011-12-24 14:11 ` Marek Lindner
0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2011-12-24 14:11 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-24 14:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-23 21:38 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix compilation with linux 2.6.29 and 2.6.30 Sven Eckelmann
2011-12-24 14:11 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox