OSDN Git Service

Staging: iop.c: move assignment out of if () block
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2015 14:21:59 +0000 (16:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 09:17:54 +0000 (11:17 +0200)
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Supriya Karanth <iskaranth@gmail.com>
CC: Somya Anand <somyaanand214@gmail.com>
CC: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/i2o/iop.c

index 23bdbe4..142aab8 100644 (file)
@@ -300,7 +300,8 @@ static int i2o_iop_quiesce(struct i2o_controller *c)
                        ADAPTER_TID);
 
        /* Long timeout needed for quiesce if lots of devices */
-       if ((rc = i2o_msg_post_wait(c, msg, 240)))
+       rc = i2o_msg_post_wait(c, msg, 240);
+       if (rc)
                osm_info("%s: Unable to quiesce (status=%#x).\n", c->name, -rc);
        else
                osm_debug("%s: Quiesced.\n", c->name);
@@ -340,7 +341,8 @@ static int i2o_iop_enable(struct i2o_controller *c)
                        ADAPTER_TID);
 
        /* How long of a timeout do we need? */
-       if ((rc = i2o_msg_post_wait(c, msg, 240)))
+       rc = i2o_msg_post_wait(c, msg, 240);
+       if (rc)
                osm_err("%s: Could not enable (status=%#x).\n", c->name, -rc);
        else
                osm_debug("%s: Enabled.\n", c->name);
@@ -406,7 +408,8 @@ static int i2o_iop_clear(struct i2o_controller *c)
            cpu_to_le32(I2O_CMD_ADAPTER_CLEAR << 24 | HOST_TID << 12 |
                        ADAPTER_TID);
 
-       if ((rc = i2o_msg_post_wait(c, msg, 30)))
+       rc = i2o_msg_post_wait(c, msg, 30);
+       if (rc)
                osm_info("%s: Unable to clear (status=%#x).\n", c->name, -rc);
        else
                osm_debug("%s: Cleared.\n", c->name);