netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/3] caif: Fix compile warning
@ 2012-02-02 11:19 Sjur Brændeland
  2012-02-02 11:19 ` [PATCH net-next 2/3] caif: Add drop count for caif_net device Sjur Brændeland
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sjur Brændeland @ 2012-02-02 11:19 UTC (permalink / raw)
  To: netdev, davem; +Cc: sjurbren, Sjur Brændeland

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

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)) {
 
-- 
1.7.5.4

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

end of thread, other threads:[~2012-02-02 19:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02 11:19 [PATCH net-next 1/3] caif: Fix compile warning Sjur Brændeland
2012-02-02 11:19 ` [PATCH net-next 2/3] caif: Add drop count for caif_net device Sjur Brændeland
2012-02-02 11:19 ` [PATCH net-next 3/3] caif: Add wakeline status tracking Sjur Brændeland
2012-02-02 19:30   ` David Miller
2012-02-02 19:29 ` [PATCH net-next 1/3] caif: Fix compile warning David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).