From cd833378bafae8036da3c2731cacc5d63a299eb9 Mon Sep 17 00:00:00 2001 From: Sang-Heon Jeon Date: Sun, 26 Jul 2026 00:08:51 +0900 Subject: [PATCH] net: remove conditional return with no effect 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 Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20260725150852.859188-4-ekffu200098@gmail.com Signed-off-by: Paolo Abeni --- drivers/net/phy/microchip_t1.c | 6 +----- drivers/net/pse-pd/tps23881.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/phy/microchip_t1.c b/drivers/net/phy/microchip_t1.c index 62b36a318100..3292b2235c8f 100644 --- a/drivers/net/phy/microchip_t1.c +++ b/drivers/net/phy/microchip_t1.c @@ -1028,11 +1028,7 @@ static int lan87xx_read_status(struct phy_device *phydev) if (rc < 0) return rc; - rc = genphy_read_status_fixed(phydev); - if (rc < 0) - return rc; - - return rc; + return genphy_read_status_fixed(phydev); } static int lan87xx_config_aneg(struct phy_device *phydev) diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 49d6389da067..8a3bbd623412 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -1520,11 +1520,7 @@ static int tps23881_i2c_probe(struct i2c_client *client) "failed to register PSE controller\n"); } - ret = tps23881_setup_irq(priv, client->irq); - if (ret) - return ret; - - return ret; + return tps23881_setup_irq(priv, client->irq); } static const struct i2c_device_id tps23881_id[] = {