drivers/rtc/rtc-pcf8583.c: move assignment outside if condition
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 3 Jul 2013 22:06:02 +0000 (15:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Jul 2013 23:07:48 +0000 (16:07 -0700)
Fixes the following checkpatch error:

  ERROR: do not use assignment in if condition

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-pcf8583.c

index 95886dcf4a39b6156d31c340d25c3bddb9ecf194..9971f7f7cac8c23381412d709b823c1c964eb552 100644 (file)
@@ -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;
        }