Re: [PATCH 29/36] rtc: pcf2127: remove conditional return with no effect
Bruno Thomsen <[email protected]> Sun, 26 Jul 2026 17:15:54 +0200
| Newsgroups | org.kernel.vger.linux-rtc,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAH+2xPB1CQ=_FgBFUZ7dg=R3wKYwu27ndybWeX8XwsKtvYFsQw@mail.gmail.com> |
Den tors. 23. jul. 2026 kl. 21.02 skrev Sang-Heon Jeon <[email protected]>: > > 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 <[email protected]> > --- > drivers/rtc/rtc-pcf2127.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c > index 1995e9f2756d..ff2023908f5a 100644 > --- a/drivers/rtc/rtc-pcf2127.c > +++ b/drivers/rtc/rtc-pcf2127.c > @@ -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); > } Reviewed-by: Bruno Thomsen <[email protected]> > > static int pcf2127_probe(struct device *dev, struct regmap *regmap, > -- > 2.43.0 > >