aboutsummaryrefslogtreecommitdiffstats
path: root/0001-iop.c-move-assignment-out-of-if-block.patch
blob: 45a8f39854488ff64ad0cba31f2808ef723d3aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 9640c5c953103d87f30d548274bc4e6d8ac3e549 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Wed, 29 Apr 2015 16:21:59 +0200
Subject: [PATCH 01/36] iop.c: move assignment out of if () block

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 |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/drivers/staging/i2o/iop.c
+++ b/drivers/staging/i2o/iop.c
@@ -300,7 +300,8 @@ static int i2o_iop_quiesce(struct i2o_co
 			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_con
 			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_cont
 	    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);