]> git.openfabrics.org - compat-rdma/compat.git/commitdiff
compat: do not include kstrto* for kernel >= 2.6.38.4
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Apr 2011 16:11:14 +0000 (18:11 +0200)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 25 Apr 2011 18:45:40 +0000 (11:45 -0700)
kstrto* went into kernel 2.6.38.4 and causes conflicts with the version
included in compat-wireless. We use strict_strtol to check if kstrto*
is already available.
kstrto* was not moved to compat-2.6.38.h because kernel version <=
2.6.38.3 needs this backport and some distributions like Ubuntu still
ship an older version of this kernel.

Reported-by: Andreas Hartmann <andihartmann@01019freenet.de>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
compat/kstrtox.c
include/linux/compat-2.6.39.h

index 05672e819f8c4c9164dd40e3752d23b8b5f63577..10aa91b44fb0f72cae67352993c975406d011c17 100644 (file)
  *
  * If -E is returned, result is not touched.
  */
+#include <linux/kernel.h>
+/* 
+ * kstrto* was included in kernel 2.6.38.4 and causes conflicts with the
+ * version included in compat-wireless. We use strict_strtol to check if
+ * kstrto* is already available.
+ */
+#ifndef strict_strtol
+
 #include <linux/ctype.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -225,3 +233,4 @@ int kstrtos8(const char *s, unsigned int base, s8 *res)
        return 0;
 }
 EXPORT_SYMBOL(kstrtos8);
+#endif /* #ifndef strict_strtol */
index 3a366e29ae7546c4af798edbfc4abe8fc0e30600..b4d85fdb12e009a17450068a3a1b39590ee9c0ab 100644 (file)
@@ -94,6 +94,12 @@ static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
 }
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) */
 
+/* 
+ * kstrto* was included in kernel 2.6.38.4 and causes conflicts with the
+ * version included in compat-wireless. We use strict_strtol to check if
+ * kstrto* is already available.
+ */
+#ifndef strict_strtol
 /* Internal, do not use. */
 int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
 int __must_check _kstrtol(const char *s, unsigned int base, long *res);
@@ -153,6 +159,7 @@ int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
 int __must_check kstrtos16(const char *s, unsigned int base, s16 *res);
 int __must_check kstrtou8(const char *s, unsigned int base, u8 *res);
 int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
+#endif /* ifndef strict_strtol */
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */