linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/16] drivers/infiniband/hw/cxgb4/cm.c: use WARN
       [not found] <1351940317-14812-1-git-send-email-Julia.Lawall@lip6.fr>
@ 2012-11-03 10:58 ` Julia Lawall
       [not found]   ` <1351940317-14812-7-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
  2012-11-03 10:58 ` [PATCH 8/16] drivers/infiniband/hw/cxgb3/iwch_cm.c: " Julia Lawall
  2012-11-03 10:58 ` [PATCH 16/16] drivers/infiniband/hw/nes: " Julia Lawall
  2 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2012-11-03 10:58 UTC (permalink / raw)
  To: Steve Wise
  Cc: kernel-janitors, Roland Dreier, Sean Hefty, Hal Rosenstock,
	linux-rdma, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use WARN rather than printk followed by WARN_ON(1), for conciseness.

A simplified version of the semantic patch that makes this transformation
is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression list es;
@@

-printk(
+WARN(1,
  es);
-WARN_ON(1);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/infiniband/hw/cxgb4/cm.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 6cfd4d8..ed048b9 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -151,9 +151,8 @@ static void stop_ep_timer(struct c4iw_ep *ep)
 {
 	PDBG("%s ep %p\n", __func__, ep);
 	if (!timer_pending(&ep->timer)) {
-		printk(KERN_ERR "%s timer stopped when its not running! "
+		WARN(1, KERN_ERR "%s timer stopped when its not running! "
 		       "ep %p state %u\n", __func__, ep, ep->com.state);
-		WARN_ON(1);
 		return;
 	}
 	del_timer_sync(&ep->timer);
@@ -2551,9 +2550,8 @@ static void process_timeout(struct c4iw_ep *ep)
 		__state_set(&ep->com, ABORTING);
 		break;
 	default:
-		printk(KERN_ERR "%s unexpected state ep %p tid %u state %u\n",
+		WARN(1, KERN_ERR "%s unexpected state ep %p tid %u state %u\n",
 			__func__, ep, ep->hwtid, ep->com.state);
-		WARN_ON(1);
 		abort = 0;
 	}
 	mutex_unlock(&ep->com.mutex);

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

* [PATCH 8/16] drivers/infiniband/hw/cxgb3/iwch_cm.c: use WARN
       [not found] <1351940317-14812-1-git-send-email-Julia.Lawall@lip6.fr>
  2012-11-03 10:58 ` [PATCH 6/16] drivers/infiniband/hw/cxgb4/cm.c: use WARN Julia Lawall
@ 2012-11-03 10:58 ` Julia Lawall
       [not found]   ` <1351940317-14812-9-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
  2012-11-03 10:58 ` [PATCH 16/16] drivers/infiniband/hw/nes: " Julia Lawall
  2 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2012-11-03 10:58 UTC (permalink / raw)
  To: Steve Wise
  Cc: kernel-janitors, Roland Dreier, Sean Hefty, Hal Rosenstock,
	linux-rdma, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use WARN rather than printk followed by WARN_ON(1), for conciseness.

A simplified version of the semantic patch that makes this transformation
is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression list es;
@@

-printk(
+WARN(1,
  es);
-WARN_ON(1);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/infiniband/hw/cxgb3/iwch_cm.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index aaf88ef..8baaf0d 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -128,9 +128,8 @@ static void stop_ep_timer(struct iwch_ep *ep)
 {
 	PDBG("%s ep %p\n", __func__, ep);
 	if (!timer_pending(&ep->timer)) {
-		printk(KERN_ERR "%s timer stopped when its not running!  ep %p state %u\n",
+		WARN(1, KERN_ERR "%s timer stopped when its not running!  ep %p state %u\n",
 			__func__, ep, ep->com.state);
-		WARN_ON(1);
 		return;
 	}
 	del_timer_sync(&ep->timer);
@@ -1756,9 +1755,8 @@ static void ep_timeout(unsigned long arg)
 		__state_set(&ep->com, ABORTING);
 		break;
 	default:
-		printk(KERN_ERR "%s unexpected state ep %p state %u\n",
+		WARN(1, KERN_ERR "%s unexpected state ep %p state %u\n",
 			__func__, ep, ep->com.state);
-		WARN_ON(1);
 		abort = 0;
 	}
 	spin_unlock_irqrestore(&ep->com.lock, flags);

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

* [PATCH 16/16] drivers/infiniband/hw/nes: use WARN
       [not found] <1351940317-14812-1-git-send-email-Julia.Lawall@lip6.fr>
  2012-11-03 10:58 ` [PATCH 6/16] drivers/infiniband/hw/cxgb4/cm.c: use WARN Julia Lawall
  2012-11-03 10:58 ` [PATCH 8/16] drivers/infiniband/hw/cxgb3/iwch_cm.c: " Julia Lawall
@ 2012-11-03 10:58 ` Julia Lawall
  2 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2012-11-03 10:58 UTC (permalink / raw)
  To: Faisal Latif
  Cc: kernel-janitors, Roland Dreier, Sean Hefty, Hal Rosenstock,
	linux-rdma, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use WARN rather than printk followed by WARN_ON(1), for conciseness.

A simplified version of the semantic patch that makes this transformation
is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression list es;
@@

-printk(
+WARN(1,
  es);
-WARN_ON(1);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/infiniband/hw/nes/nes_cm.c  |    6 ++----
 drivers/infiniband/hw/nes/nes_mgt.c |    6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index cfaacaf..8a15a1d 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -629,11 +629,9 @@ static void build_rdma0_msg(struct nes_cm_node *cm_node, struct nes_qp **nesqp_a
 
 	case SEND_RDMA_READ_ZERO:
 	default:
-		if (cm_node->send_rdma0_op != SEND_RDMA_READ_ZERO) {
-			printk(KERN_ERR "%s[%u]: Unsupported RDMA0 len operation=%u\n",
+		if (cm_node->send_rdma0_op != SEND_RDMA_READ_ZERO)
+			WARN(1, KERN_ERR "%s[%u]: Unsupported RDMA0 len operation=%u\n",
 				 __func__, __LINE__, cm_node->send_rdma0_op);
-			WARN_ON(1);
-		}
 		nes_debug(NES_DBG_CM, "Sending first rdma operation.\n");
 		wqe->wqe_words[NES_IWARP_SQ_WQE_MISC_IDX] =
 			cpu_to_le32(NES_IWARP_SQ_OP_RDMAR);
diff --git a/drivers/infiniband/hw/nes/nes_mgt.c b/drivers/infiniband/hw/nes/nes_mgt.c
index 3ba7be3..53bb88c 100644
--- a/drivers/infiniband/hw/nes/nes_mgt.c
+++ b/drivers/infiniband/hw/nes/nes_mgt.c
@@ -649,11 +649,9 @@ static void nes_chg_qh_handler(struct nes_device *nesdev, struct nes_cqp_request
 	nesqp = qh_chg->nesqp;
 
 	/* Should we handle the bad completion */
-	if (cqp_request->major_code) {
-		printk(KERN_ERR PFX "Invalid cqp_request major_code=0x%x\n",
+	if (cqp_request->major_code)
+		WARN(1, KERN_ERR PFX "Invalid cqp_request major_code=0x%x\n",
 		       cqp_request->major_code);
-		WARN_ON(1);
-	}
 
 	switch (nesqp->pau_state) {
 	case PAU_DEL_QH:

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

* Re: [PATCH 8/16] drivers/infiniband/hw/cxgb3/iwch_cm.c: use WARN
       [not found]   ` <1351940317-14812-9-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
@ 2012-11-03 12:39     ` Steve Wise
  0 siblings, 0 replies; 5+ messages in thread
From: Steve Wise @ 2012-11-03 12:39 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Steve Wise, kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Roland Dreier,
	Sean Hefty, Hal Rosenstock, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA


Acked-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 6/16] drivers/infiniband/hw/cxgb4/cm.c: use WARN
       [not found]   ` <1351940317-14812-7-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
@ 2012-11-03 12:40     ` Steve Wise
  0 siblings, 0 replies; 5+ messages in thread
From: Steve Wise @ 2012-11-03 12:40 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Steve Wise, kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Roland Dreier,
	Sean Hefty, Hal Rosenstock, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Acked-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-11-03 12:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1351940317-14812-1-git-send-email-Julia.Lawall@lip6.fr>
2012-11-03 10:58 ` [PATCH 6/16] drivers/infiniband/hw/cxgb4/cm.c: use WARN Julia Lawall
     [not found]   ` <1351940317-14812-7-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
2012-11-03 12:40     ` Steve Wise
2012-11-03 10:58 ` [PATCH 8/16] drivers/infiniband/hw/cxgb3/iwch_cm.c: " Julia Lawall
     [not found]   ` <1351940317-14812-9-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
2012-11-03 12:39     ` Steve Wise
2012-11-03 10:58 ` [PATCH 16/16] drivers/infiniband/hw/nes: " Julia Lawall

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