]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
RDMA/cxgb4: use WARN
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 3 Nov 2012 10:58:27 +0000 (10:58 +0000)
committerRoland Dreier <roland@purestorage.com>
Mon, 26 Nov 2012 19:07:18 +0000 (11:07 -0800)
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>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/cxgb4/cm.c

index 6cfd4d8fd0bd8e240dd1311698a2cf603fcfed15..5de86968379d265e1c1046b6742efb6c36978328 100644 (file)
@@ -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, "%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, "%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);