Patchwork [net-next,1/3] caif: Fix compile warning

login
register
mail settings
Submitter sjur.brandeland@stericsson.com
Date Feb. 2, 2012, 11:19 a.m.
Message ID <1328181565-13781-1-git-send-email-sjur.brandeland@stericsson.com>
Download mbox | patch
Permalink /patch/139117/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

sjur.brandeland@stericsson.com - Feb. 2, 2012, 11:19 a.m.
Fix compile warning:
... warning: statement with no effect [-Wunused-value]
This warning is seen when debug-fs is disabled. Fix this
by adding new macro for use when no return value is needed.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
---
 net/caif/caif_socket.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
David Miller - Feb. 2, 2012, 7:29 p.m.
From: Sjur Brændeland <sjur.brandeland@stericsson.com>
Date: Thu,  2 Feb 2012 12:19:23 +0100

> Fix compile warning:
> ... warning: statement with no effect [-Wunused-value]
> This warning is seen when debug-fs is disabled. Fix this
> by adding new macro for use when no return value is needed.
> 
> Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>

Seriously, just get rid of this debug code.

You'll feel very much relieved afterwards.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index a986280..543f23c 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -60,11 +60,13 @@  struct debug_fs_counter {
 	atomic_t num_rx_flow_on;
 };
 static struct debug_fs_counter cnt;
-#define	dbfs_atomic_inc(v) atomic_inc_return(v)
-#define	dbfs_atomic_dec(v) atomic_dec_return(v)
+#define	dbfs_atomic_inc(v) atomic_inc(v)
+#define	dbfs_atomic_dec(v) atomic_dec(v)
+#define	dbfs_atomic_inc_ret(v) atomic_inc_return(v)
 #else
-#define	dbfs_atomic_inc(v) 0
-#define	dbfs_atomic_dec(v) 0
+#define	dbfs_atomic_inc_ret(v) 0
+#define	dbfs_atomic_inc(v)
+#define	dbfs_atomic_dec(v)
 #endif
 
 struct caifsock {
@@ -1122,7 +1124,7 @@  static int caif_create(struct net *net, struct socket *sock, int protocol,
 	cf_sk->conn_req.protocol = protocol;
 	/* Increase the number of sockets created. */
 	dbfs_atomic_inc(&cnt.caif_nr_socks);
-	num = dbfs_atomic_inc(&cnt.caif_sock_create);
+	num = dbfs_atomic_inc_ret(&cnt.caif_sock_create);
 #ifdef CONFIG_DEBUG_FS
 	if (!IS_ERR(debugfsdir)) {