Skip to contentSkip to conversation

9P compile fix

PATCH In review Meelis Roos 3 participants 4 messages Jul 16, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

include/net/9p/9p.h +2 -2
index 88884d3..8fc3796 100644
@@ -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) \
Signature · 1 line
Meelis Roos ([email protected])
#1 lore raw

PATCH 1/1 9p: fix debug compilation error

From: Meelis Roos <[email protected]>

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)

---
 include/net/9p/9p.h |    4 ++--
 net/9p/mod.c        |    2 --
 2 files changed, 2 insertions(+), 4 deletions(-)
include/net/9p/9p.h +2 -2
index 88884d3..8fc3796 100644
@@ -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) \
net/9p/mod.c +0 -2
index 4f9e1d2..951bb1d 100644
@@ -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);
Signature · 1 line
1.5.0.2.gfbe3d-dirty
#2 lore raw

Re: [PATCH] 9p: fix debug compilation error

Quoted 7 lines · Eric Van Hensbergen

From: Meelis Roos <[email protected]>

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)

Quoted 5 lines

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)

fs/9p/v9fs.c renamed from fs/9p/v9fs.c~ +2 -0
@@ -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;
Signature · 1 line
http://www.codemonkey.org.uk
#3 lore raw

Re: [PATCH] 9p: fix debug compilation error

Quoted 11 lines · Dave Jones
Quoted 10 lines · Eric Van Hensbergen

From: Meelis Roos <[email protected]>

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.

Quoted 6 lines
Quoted 2 lines

(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.

Quoted 9 lines

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)

Quoted 17 lines
fs/9p/v9fs.c 2007-07-16 11:46:12.000000000 -0400 renamed from fs/9p/v9fs.c~ 2007-07-16 11:45:56.000000000 -0400 +2 -1
@@ -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