rtc: pcf2127: remove conditional return with no effect
authorSang-Heon Jeon <ekffu200098@gmail.com>
Thu, 23 Jul 2026 18:45:31 +0000 (03:45 +0900)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 19 Aug 2026 22:08:35 +0000 (00:08 +0200)
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Reviewed-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Link: https://patch.msgid.link/20260723184538.3888637-30-ekffu200098@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-pcf2127.c

index 1995e9f..ff20239 100644 (file)
@@ -1184,12 +1184,7 @@ static int pcf2127_configure_interrupt_pins(struct device *dev)
        if (ret)
                return ret;
 
-       ret = regmap_write(pcf2127->regmap,
-                          PCF2131_REG_INT_A_MASK2, 0);
-       if (ret)
-               return ret;
-
-       return ret;
+       return regmap_write(pcf2127->regmap, PCF2131_REG_INT_A_MASK2, 0);
 }
 
 static int pcf2127_probe(struct device *dev, struct regmap *regmap,