linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] compat: do not include kstrto* for kernel >= 2.6.38.4
@ 2011-04-24 16:11 Hauke Mehrtens
  2011-04-24 16:11 ` [PATCH 2/2] compat: fix TASK_INTERRUPTIBLE missing Hauke Mehrtens
  2011-04-24 19:00 ` [PATCH 1/2] compat: do not include kstrto* for kernel >= 2.6.38.4 Andreas Hartmann
  0 siblings, 2 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2011-04-24 16:11 UTC (permalink / raw)
  To: mcgrof, lrodriguez; +Cc: linux-wireless, Hauke Mehrtens

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              |    9 +++++++++
 include/linux/compat-2.6.39.h |    7 +++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/compat/kstrtox.c b/compat/kstrtox.c
index 05672e8..10aa91b 100644
--- a/compat/kstrtox.c
+++ b/compat/kstrtox.c
@@ -11,6 +11,14 @@
  *
  * 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 */
diff --git a/include/linux/compat-2.6.39.h b/include/linux/compat-2.6.39.h
index 3a366e2..b4d85fd 100644
--- a/include/linux/compat-2.6.39.h
+++ b/include/linux/compat-2.6.39.h
@@ -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)) */
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] compat: fix TASK_INTERRUPTIBLE missing
  2011-04-24 16:11 [PATCH 1/2] compat: do not include kstrto* for kernel >= 2.6.38.4 Hauke Mehrtens
@ 2011-04-24 16:11 ` Hauke Mehrtens
  2011-04-25 18:46   ` Luis R. Rodriguez
  2011-04-24 19:00 ` [PATCH 1/2] compat: do not include kstrto* for kernel >= 2.6.38.4 Andreas Hartmann
  1 sibling, 1 reply; 4+ messages in thread
From: Hauke Mehrtens @ 2011-04-24 16:11 UTC (permalink / raw)
  To: mcgrof, lrodriguez; +Cc: linux-wireless, Hauke Mehrtens

When compiling against the Ubuntu Natty kernel (2.6.38-8-generic)
TASK_INTERRUPTIBLE is not defined here.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 compat/compat-2.6.39.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/compat/compat-2.6.39.c b/compat/compat-2.6.39.c
index 8d85877..5bb9322 100644
--- a/compat/compat-2.6.39.c
+++ b/compat/compat-2.6.39.c
@@ -10,6 +10,7 @@
 
 #include <linux/compat.h>
 #include <linux/tty.h>
+#include <linux/sched.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 /*
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] compat: do not include kstrto* for kernel >= 2.6.38.4
  2011-04-24 16:11 [PATCH 1/2] compat: do not include kstrto* for kernel >= 2.6.38.4 Hauke Mehrtens
  2011-04-24 16:11 ` [PATCH 2/2] compat: fix TASK_INTERRUPTIBLE missing Hauke Mehrtens
@ 2011-04-24 19:00 ` Andreas Hartmann
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Hartmann @ 2011-04-24 19:00 UTC (permalink / raw)
  To: linux-wireless

Hauke Mehrtens wrote:
> 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>

The patch works fine - I tested it with compat-wireless-2011-04-23.


Thank you,
kind regards,
Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] compat: fix TASK_INTERRUPTIBLE missing
  2011-04-24 16:11 ` [PATCH 2/2] compat: fix TASK_INTERRUPTIBLE missing Hauke Mehrtens
@ 2011-04-25 18:46   ` Luis R. Rodriguez
  0 siblings, 0 replies; 4+ messages in thread
From: Luis R. Rodriguez @ 2011-04-25 18:46 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless

On Sun, Apr 24, 2011 at 9:11 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> When compiling against the Ubuntu Natty kernel (2.6.38-8-generic)
> TASK_INTERRUPTIBLE is not defined here.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Applied both and pushed, thanks!

  Luis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-25 18:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-24 16:11 [PATCH 1/2] compat: do not include kstrto* for kernel >= 2.6.38.4 Hauke Mehrtens
2011-04-24 16:11 ` [PATCH 2/2] compat: fix TASK_INTERRUPTIBLE missing Hauke Mehrtens
2011-04-25 18:46   ` Luis R. Rodriguez
2011-04-24 19:00 ` [PATCH 1/2] compat: do not include kstrto* for kernel >= 2.6.38.4 Andreas Hartmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).