Re: [net/9p/9pnet.c] Compile error

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Van Hensbergen
Date: Monday, October 20, 2008 - 2:04 pm

On Mon, Oct 20, 2008 at 3:49 PM, Jason Baron <jbaron@redhat.com> wrote:

Sorry for the mess.  I'm pushing the following patch to my for-linus
tree which resolves the issue.

           -eric

9p: fix debug build error

Fixes build problem with 9p when building with debug disabled.
Also contains some fixes for warnings which pop up when
CONFIG_NET_9P_DEBUG is disabled.

Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index d2c60c7..b77c147 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -56,9 +56,9 @@ enum p9_debug_flags {
 	P9_DEBUG_PKT =		(1<<10),
 };

+#ifdef CONFIG_NET_9P_DEBUG
 extern unsigned int p9_debug_level;

-#ifdef CONFIG_NET_9P_DEBUG
 #define P9_DPRINTK(level, format, arg...) \
 do {  \
 	if ((p9_debug_level & level) == level) {\
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 29be524..908e79f 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -53,6 +53,7 @@
 static int
 p9pdu_writef(struct p9_fcall *pdu, int optional, const char *fmt, ...);

+#ifdef CONFIG_NET_9P_DEBUG
 void
 p9pdu_dump(int way, struct p9_fcall *pdu)
 {
@@ -81,6 +82,12 @@ p9pdu_dump(int way, struct p9_fcall *pdu)
 	else
 		P9_DPRINTK(P9_DEBUG_PKT, "]]](%d) %s\n", datalen, buf);
 }
+#else
+void
+p9pdu_dump(int way, struct p9_fcall *pdu)
+{
+}
+#endif
 EXPORT_SYMBOL(p9pdu_dump);

 void p9stat_free(struct p9_wstat *stbuf)
@@ -542,8 +549,10 @@ int p9pdu_finalize(struct p9_fcall *pdu)
 	err = p9pdu_writef(pdu, 0, "d", size);
 	pdu->size = size;

+#ifdef CONFIG_NET_9P_DEBUG
 	if ((p9_debug_level & P9_DEBUG_PKT) == P9_DEBUG_PKT)
 		p9pdu_dump(0, pdu);
+#endif

 	P9_DPRINTK(P9_DEBUG_9P, ">>> size=%d type: %d tag: %d\n", pdu->size,
 							pdu->id, pdu->tag);
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index be65d82..1df0356 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -678,11 +678,9 @@ static int p9_fd_request(struct p9_client
*client, struct p9_req_t *req)

 static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req)
 {
-	struct p9_trans_fd *ts = client->trans;
-	struct p9_conn *m = ts->conn;
 	int ret = 1;

-	P9_DPRINTK(P9_DEBUG_TRANS, "mux %p req %p\n", m, req);
+	P9_DPRINTK(P9_DEBUG_TRANS, "client %p req %p\n", client, req);

 	spin_lock(&client->lock);
 	list_del(&req->req_list);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[net/9p/9pnet.c] Compile error, Alejandro Riveira , (Mon Oct 20, 12:27 pm)
Re: [net/9p/9pnet.c] Compile error, Jason Baron, (Mon Oct 20, 1:49 pm)
Re: [net/9p/9pnet.c] Compile error, Eric Van Hensbergen, (Mon Oct 20, 2:04 pm)
Re: [net/9p/9pnet.c] Compile error, Alejandro Riveira , (Tue Oct 21, 2:17 am)