Patchwork [21/26] drivers/rtc/rtc-pcf8583.c: Move assignment outside if condition

login
register
mail settings
Submitter Sachin Kamat
Date May 3, 2013, 6:21 a.m.
Message ID <1367562076-25713-22-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/241197/
State New
Headers show

Comments

Sachin Kamat - May 3, 2013, 6:21 a.m.
Fixes the following checkpatch error:
ERROR: do not use assignment in if condition

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/rtc/rtc-pcf8583.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c
index 95886dc..9971f7f 100644
--- a/drivers/rtc/rtc-pcf8583.c
+++ b/drivers/rtc/rtc-pcf8583.c
@@ -188,7 +188,8 @@  static int pcf8583_rtc_read_time(struct device *dev, struct rtc_time *tm)
 		dev_warn(dev, "resetting control %02x -> %02x\n",
 			ctrl, new_ctrl);
 
-		if ((err = pcf8583_set_ctrl(client, &new_ctrl)) < 0)
+		err = pcf8583_set_ctrl(client, &new_ctrl);
+		if (err < 0)
 			return err;
 	}