rtc: max8925: remove redundant check on ret
authorColin Ian King <colin.king@canonical.com>
Wed, 7 Jun 2017 15:26:15 +0000 (16:26 +0100)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sun, 30 Jul 2017 22:17:48 +0000 (00:17 +0200)
The check on ret < 0 is redundant as the goto destination is the
next statment.  Remove this redudant check and goto.

Detected by CoverityScan, CID#1268785 ("Identical code for different
branches")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-max8925.c

index 16d129a0bb3bfbebc1fb97a436ac3ee59a20ef4a..67d6fc2d23e6085bb8c6004fa753371f22ce059b 100644 (file)
@@ -234,8 +234,6 @@ static int max8925_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
                ret = max8925_reg_write(info->rtc, MAX8925_ALARM0_CNTL, 0x77);
        else
                ret = max8925_reg_write(info->rtc, MAX8925_ALARM0_CNTL, 0x0);
-       if (ret < 0)
-               goto out;
 out:
        return ret;
 }