Skip to contentSkip to conversation

svcrdma: fix a couple warning messages

PATCH In review Dan Carpenter 2 participants 2 messages Jan 5, 2016 – Jan 6, 2016

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

PATCH 1/1 svcrdma: fix a couple warning messages

The WARN_ON_ONCE() macro takes a condition, passing it this string literal sort of works as intended but it's better to use WARN_ONCE() instead.

net/sunrpc/xprtrdma/svc_rdma_transport.c +2 -2
index abfbd02..4b397ad 100644
@@ -221,7 +221,7 @@ out_empty:
 	spin_lock_bh(&xprt->sc_ctxt_lock);
 	xprt->sc_ctxt_used--;
 	spin_unlock_bh(&xprt->sc_ctxt_lock);
-	WARN_ON_ONCE("svcrdma: empty RDMA ctxt list?\n");
+	WARN_ONCE(1, "svcrdma: empty RDMA ctxt list?\n");
 	return NULL;
 }
 
@@ -328,7 +328,7 @@ out_empty:
 	if (map)
 		goto out;
 
-	WARN_ON_ONCE("svcrdma: empty request map list?\n");
+	WARN_ONCE(1, "svcrdma: empty request map list?\n");
 	return NULL;
 }
 
#1 lore raw
Quoted 8 lines · Dan Carpenter

The WARN_ON_ONCE() macro takes a condition, passing it this string literal sort of works as intended but it's better to use WARN_ONCE() instead.

Hi Dan, I have to rebase and resubmit this series anyway. I've squashed both your fixes into the original patches that introduced the issues.

Thanks for reporting!

Quoted 23 lines
net/sunrpc/xprtrdma/svc_rdma_transport.c +2 -3
index abfbd02..4b397ad 100644
@@ -221,7 +221,7 @@ out_empty:
 	spin_lock_bh(&xprt->sc_ctxt_lock);
 	xprt->sc_ctxt_used--;
 	spin_unlock_bh(&xprt->sc_ctxt_lock);
-	WARN_ON_ONCE("svcrdma: empty RDMA ctxt list?\n");
+	WARN_ONCE(1, "svcrdma: empty RDMA ctxt list?\n");
 	return NULL;
 }
 
@@ -328,7 +328,7 @@ out_empty:
 	if (map)
 		goto out;
 
-	WARN_ON_ONCE("svcrdma: empty request map list?\n");
+	WARN_ONCE(1, "svcrdma: empty request map list?\n");
 	return NULL;
 }
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever