[cocci] [PATCH 26/36] power: supply: pm8916_lbc: remove conditional return with no effect

Sang-Heon Jeon <[email protected]> Fri, 24 Jul 2026 03:45:28 +0900
Newsgroups fr.inria.cocci,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm
Message-ID <[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/power/supply/pm8916_lbc.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
index cdc4d78c4219..569f3f4b16fe 100644
--- a/drivers/power/supply/pm8916_lbc.c
+++ b/drivers/power/supply/pm8916_lbc.c
@@ -231,11 +231,9 @@ static int pm8916_lbc_charger_probe_dt(struct pm8916_lbc_charger *chg)
 		return ret;
 
 	/* Disable charger timeout. */
-	ret = regmap_write(chg->regmap, chg->reg[LBC_CHGR] + PM8916_LBC_CHGR_TCHG_MAX_EN, 0x00);
-	if (ret)
-		return ret;
-
-	return ret;
+	return regmap_write(chg->regmap,
+			    chg->reg[LBC_CHGR] + PM8916_LBC_CHGR_TCHG_MAX_EN,
+			    0x00);
 }
 
 static const struct power_supply_desc pm8916_lbc_charger_psy_desc = {
-- 
2.43.0