public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix compilation with linux 2.6.29 and 2.6.30
Date: Fri, 23 Dec 2011 22:38:01 +0100	[thread overview]
Message-ID: <1324676281-20118-1-git-send-email-sven@narfation.org> (raw)

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


             reply	other threads:[~2011-12-23 21:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23 21:38 Sven Eckelmann [this message]
2011-12-24 14:11 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Fix compilation with linux 2.6.29 and 2.6.30 Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324676281-20118-1-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox