* Re: [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c
2005-08-04 13:48 [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c Mathieu Chouquet-Stringer
@ 2005-08-04 14:12 ` David S. Miller
2005-08-04 14:24 ` Mathieu Chouquet-Stringer
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2005-08-04 14:12 UTC (permalink / raw)
To: sparclinux
From: Mathieu Chouquet-Stringer <mchouque@free.fr>
Subject: [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c
Date: Thu, 04 Aug 2005 09:48:03 -0400
> errno is already declarded in linux/errno.h:
Where? It _is_ defined in linux/unistd.h and the fact that
we're indirectly getting that header file somehow is the
source of the problem.
> Moreover errno isn't used in this file at all so the following patch
> (against latest git tree) just removes it (kernel compiles fine).
It is used implicitly by the system call macros inside
of asm-*/unistd.h, for example in the _syscall?() macros.
And we do call execve() in envctrl.c which expands to one
of those macros (specifically, _syscall3()).
So you patch is not correct.
Probably the best version of the fix would be to include
linux/unistd.h instead of asm/unistd.h, so you might want
to code that up and test it out.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c
2005-08-04 13:48 [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c Mathieu Chouquet-Stringer
2005-08-04 14:12 ` David S. Miller
@ 2005-08-04 14:24 ` Mathieu Chouquet-Stringer
2005-08-06 4:39 ` Mathieu Chouquet-Stringer
2005-08-06 13:40 ` David S. Miller
3 siblings, 0 replies; 5+ messages in thread
From: Mathieu Chouquet-Stringer @ 2005-08-04 14:24 UTC (permalink / raw)
To: sparclinux
On Thu, Aug 04, 2005 at 07:12:26AM -0700, David S. Miller wrote:
> Where? It _is_ defined in linux/unistd.h and the fact that
> we're indirectly getting that header file somehow is the
> source of the problem.
Yeah, I guess I shouldn't send emails early in the morning... :-)
> [snip]
> So you patch is not correct.
>
> Probably the best version of the fix would be to include
> linux/unistd.h instead of asm/unistd.h, so you might want
> to code that up and test it out.
Ok, trying this out...
--
Mathieu Chouquet-Stringer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c
2005-08-04 13:48 [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c Mathieu Chouquet-Stringer
2005-08-04 14:12 ` David S. Miller
2005-08-04 14:24 ` Mathieu Chouquet-Stringer
@ 2005-08-06 4:39 ` Mathieu Chouquet-Stringer
2005-08-06 13:40 ` David S. Miller
3 siblings, 0 replies; 5+ messages in thread
From: Mathieu Chouquet-Stringer @ 2005-08-06 4:39 UTC (permalink / raw)
To: sparclinux
On Thu, Aug 04, 2005 at 07:12:26AM -0700, David S. Miller wrote:
> [snip]
> Probably the best version of the fix would be to include
> linux/unistd.h instead of asm/unistd.h, so you might want
> to code that up and test it out.
Thanks for the feedback, what about the following then? It's compiled and
booted and I've realized than bbc_envctrl.c suffers from the same
thing, so here you go. Let me know if it makes sense...
Signed-off-by: Mathieu Chouquet-Stringer <mchouque@free.fr>
--- linux-2.6/drivers/sbus/char/envctrl.c 2005-07-25 20:28:43.000000000 -0400
+++ linux-2.6-mat/drivers/sbus/char/envctrl.c 2005-08-06 00:02:04.000000000 -0400
@@ -32,14 +32,12 @@
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/kernel.h>
+#include <linux/unistd.h>
#include <asm/ebus.h>
#include <asm/uaccess.h>
#include <asm/envctrl.h>
-static int errno;
-#include <asm/unistd.h>
-
#define ENVCTRL_MINOR 162
#define PCF8584_ADDRESS 0x55
--- linux-2.6/drivers/sbus/char/bbc_envctrl.c 2005-07-25 20:28:43.000000000 -0400
+++ linux-2.6-mat/drivers/sbus/char/bbc_envctrl.c 2005-08-06 00:06:27.000000000 -0400
@@ -10,10 +10,9 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/delay.h>
+#include <linux/unistd.h>
#include <asm/oplib.h>
#include <asm/ebus.h>
-static int errno;
-#include <asm/unistd.h>
#include "bbc_i2c.h"
#include "max1617.h"
--
Mathieu Chouquet-Stringer E-Mail: mchouque@free.fr
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c
2005-08-04 13:48 [PATCH] Remove errno declaration in drivers/sbus/char/envctrl.c Mathieu Chouquet-Stringer
` (2 preceding siblings ...)
2005-08-06 4:39 ` Mathieu Chouquet-Stringer
@ 2005-08-06 13:40 ` David S. Miller
3 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2005-08-06 13:40 UTC (permalink / raw)
To: sparclinux
From: Mathieu Chouquet-Stringer <mchouque@free.fr>
Date: Sat, 06 Aug 2005 00:39:11 -0400
> Thanks for the feedback, what about the following then? It's compiled and
> booted and I've realized than bbc_envctrl.c suffers from the same
> thing, so here you go. Let me know if it makes sense...
>
> Signed-off-by: Mathieu Chouquet-Stringer <mchouque@free.fr>
Looks good, patch applied, thanks a lot.
^ permalink raw reply [flat|nested] 5+ messages in thread