All of lore.kernel.org
 help / color / mirror / Atom feed
* 9P compile fix
@ 2007-07-16 11:41 Meelis Roos
  2007-07-16 14:47 ` [PATCH] 9p: fix debug compilation error Eric Van Hensbergen
  0 siblings, 1 reply; 4+ messages in thread
From: Meelis Roos @ 2007-07-16 11:41 UTC (permalink / raw)
  To: Linux Kernel list; +Cc: ericvh

With 9P but no 9P debug options, this error occurs:
  CC [M]  fs/9p/v9fs.o
fs/9p/v9fs.c: In function 'v9fs_parse_options':
fs/9p/v9fs.c:134: error: 'p9_debug_level' undeclared (first use in this function)

The following patch moves the definition of p9_debug_level out of #ifdef 
and seems to fix the compilation.

Signed-off-by: Meelis Roos <mroos@linux.ee>

diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 88884d3..8fc3796 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -27,6 +27,8 @@
 #ifndef NET_9P_H
 #define NET_9P_H
 
+extern unsigned int p9_debug_level;
+
 #ifdef CONFIG_NET_9P_DEBUG
 
 #define P9_DEBUG_ERROR		(1<<0)
@@ -38,8 +40,6 @@
 #define P9_DEBUG_SLABS	      	(1<<7)
 #define P9_DEBUG_FCALL		(1<<8)
 
-extern unsigned int p9_debug_level;
-
 #define P9_DPRINTK(level, format, arg...) \
 do {  \
 	if ((p9_debug_level & level) == level) \

-- 
Meelis Roos (mroos@linux.ee)

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

* [PATCH] 9p: fix debug compilation error
  2007-07-16 11:41 9P compile fix Meelis Roos
@ 2007-07-16 14:47 ` Eric Van Hensbergen
  2007-07-16 15:49   ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Van Hensbergen @ 2007-07-16 14:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Meelis Roos, Eric Van Hensbergren

From: Meelis Roos <mroos@linux.ee>

With 9P but no 9P debug options, this error occurs:
  CC [M]  fs/9p/v9fs.o
fs/9p/v9fs.c: In function 'v9fs_parse_options':
fs/9p/v9fs.c:134: error: 'p9_debug_level' undeclared (first use in this function)

The following patch moves the definition of p9_debug_level out of #ifdef
and seems to fix the problem.

(Original patch took care of the extern definition in the includes, but
not the actual definition in mod.c - ericvh)

Signed-off-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Eric Van Hensbergren <ericvh@gmail.com>
---
 include/net/9p/9p.h |    4 ++--
 net/9p/mod.c        |    2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 88884d3..8fc3796 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -27,6 +27,8 @@
 #ifndef NET_9P_H
 #define NET_9P_H
 
+extern unsigned int p9_debug_level;
+
 #ifdef CONFIG_NET_9P_DEBUG
 
 #define P9_DEBUG_ERROR		(1<<0)
@@ -38,8 +40,6 @@
 #define P9_DEBUG_SLABS	      	(1<<7)
 #define P9_DEBUG_FCALL		(1<<8)
 
-extern unsigned int p9_debug_level;
-
 #define P9_DPRINTK(level, format, arg...) \
 do {  \
 	if ((p9_debug_level & level) == level) \
diff --git a/net/9p/mod.c b/net/9p/mod.c
index 4f9e1d2..951bb1d 100644
--- a/net/9p/mod.c
+++ b/net/9p/mod.c
@@ -28,12 +28,10 @@
 #include <linux/moduleparam.h>
 #include <net/9p/9p.h>
 
-#ifdef CONFIG_NET_9P_DEBUG
 unsigned int p9_debug_level = 0;	/* feature-rific global debug level  */
 EXPORT_SYMBOL(p9_debug_level);
 module_param_named(debug, p9_debug_level, uint, 0);
 MODULE_PARM_DESC(debug, "9P debugging level");
-#endif
 
 extern int p9_mux_global_init(void);
 extern void p9_mux_global_exit(void);
-- 
1.5.0.2.gfbe3d-dirty


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

* Re: [PATCH] 9p: fix debug compilation error
  2007-07-16 14:47 ` [PATCH] 9p: fix debug compilation error Eric Van Hensbergen
@ 2007-07-16 15:49   ` Dave Jones
  2007-07-16 21:02     ` Eric Van Hensbergen
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Jones @ 2007-07-16 15:49 UTC (permalink / raw)
  To: Eric Van Hensbergen; +Cc: linux-kernel, Meelis Roos

On Mon, Jul 16, 2007 at 09:47:49AM -0500, Eric Van Hensbergen wrote:
 > From: Meelis Roos <mroos@linux.ee>
 > 
 > With 9P but no 9P debug options, this error occurs:
 >   CC [M]  fs/9p/v9fs.o
 > fs/9p/v9fs.c: In function 'v9fs_parse_options':
 > fs/9p/v9fs.c:134: error: 'p9_debug_level' undeclared (first use in this function)
 > 
 > The following patch moves the definition of p9_debug_level out of #ifdef
 > and seems to fix the problem.
 > 
 > (Original patch took care of the extern definition in the includes, but
 > not the actual definition in mod.c - ericvh)

Seems somewhat wasteful to include the debug options when the config
option has been disabled though.
Wouldn't something like this (untested) make more sense ?

	Dave

---  

fs/9p/v9fs.c: In function 'v9fs_parse_options':
fs/9p/v9fs.c:134: error: 'p9_debug_level' undeclared (first use in this function)

Signed-off-by: Dave Jones <davej@redhat.com>

--- linux-2.6.22.noarch/fs/9p/v9fs.c~	2007-07-16 11:45:56.000000000 -0400
+++ linux-2.6.22.noarch/fs/9p/v9fs.c	2007-07-16 11:46:12.000000000 -0400
@@ -131,7 +131,9 @@ static void v9fs_parse_options(char *opt
 		switch (token) {
 		case Opt_debug:
 			v9ses->debug = option;
+#ifdef CONFIG_NET_9P_DEBUG
 			p9_debug_level = option;
+#endif
 			break;
 		case Opt_port:
 			v9ses->port = option;

-- 
http://www.codemonkey.org.uk

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

* Re: [PATCH] 9p: fix debug compilation error
  2007-07-16 15:49   ` Dave Jones
@ 2007-07-16 21:02     ` Eric Van Hensbergen
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Van Hensbergen @ 2007-07-16 21:02 UTC (permalink / raw)
  To: Dave Jones, linux-kernel, Meelis Roos

On 7/16/07, Dave Jones <davej@redhat.com> wrote:
> On Mon, Jul 16, 2007 at 09:47:49AM -0500, Eric Van Hensbergen wrote:
>  > From: Meelis Roos <mroos@linux.ee>
>  >
>  > With 9P but no 9P debug options, this error occurs:
>  >   CC [M]  fs/9p/v9fs.o
>  > fs/9p/v9fs.c: In function 'v9fs_parse_options':
>  > fs/9p/v9fs.c:134: error: 'p9_debug_level' undeclared (first use in this function)
>  >
>  > The following patch moves the definition of p9_debug_level out of #ifdef
>  > and seems to fix the problem.
>  >
>  > (Original patch took care of the extern definition in the includes, but
>  > not the actual definition in mod.c - ericvh)
>
> Seems somewhat wasteful to include the debug options when the config
> option has been disabled though.
> Wouldn't something like this (untested) make more sense ?

Fair enough.  Looks like I introduced this when I put back the
mount-time debug option.

>
>         Dave
>
> ---
>
> fs/9p/v9fs.c: In function 'v9fs_parse_options':
> fs/9p/v9fs.c:134: error: 'p9_debug_level' undeclared (first use in this function)
>
> Signed-off-by: Dave Jones <davej@redhat.com>
Acked-by: Eric Van Hensbergen <ericvh@gmail.com>

>
> --- linux-2.6.22.noarch/fs/9p/v9fs.c~   2007-07-16 11:45:56.000000000 -0400
> +++ linux-2.6.22.noarch/fs/9p/v9fs.c    2007-07-16 11:46:12.000000000 -0400
> @@ -131,7 +131,9 @@ static void v9fs_parse_options(char *opt
>                 switch (token) {
>                 case Opt_debug:
>                         v9ses->debug = option;
> +#ifdef CONFIG_NET_9P_DEBUG
>                         p9_debug_level = option;
> +#endif
>                         break;
>                 case Opt_port:
>                         v9ses->port = option;
>
> --
> http://www.codemonkey.org.uk
>

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

end of thread, other threads:[~2007-07-16 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-16 11:41 9P compile fix Meelis Roos
2007-07-16 14:47 ` [PATCH] 9p: fix debug compilation error Eric Van Hensbergen
2007-07-16 15:49   ` Dave Jones
2007-07-16 21:02     ` Eric Van Hensbergen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.