From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: kuba@kernel.org, Arun Ramadoss <arun.ramadoss@microchip.com>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Kory Maincent <kory.maincent@bootlin.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Russell King <linux@armlinux.org.uk>,
UNGLinuxDriver@microchip.com
Subject: [PATCH net-next v2 3/4] net: remove conditional return with no effect
Date: Sun, 26 Jul 2026 00:08:51 +0900 [thread overview]
Message-ID: <20260725150852.859188-4-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260725150852.859188-1-ekffu200098@gmail.com>
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: Andrew Lunn <andrew@lunn.ch>
---
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[] = {
--
2.43.0
next prev parent reply other threads:[~2026-07-25 15:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 15:08 [PATCH net-next v2 0/4] net: remove conditional returns with no effect Sang-Heon Jeon
2026-07-25 15:08 ` [Intel-wired-lan] " Sang-Heon Jeon
2026-07-25 15:08 ` [PATCH net-next v2 1/4] dpll: zl3073x: remove conditional return " Sang-Heon Jeon
2026-07-27 9:57 ` Ivan Vecera
2026-07-25 15:08 ` [PATCH net-next v2 2/4] net: ethernet: " Sang-Heon Jeon
2026-07-27 11:27 ` Ioana Ciornei
2026-07-25 15:08 ` Sang-Heon Jeon [this message]
2026-07-25 15:08 ` [Intel-wired-lan] [PATCH net-next v2 4/4] net: intel: " Sang-Heon Jeon
2026-07-25 15:08 ` Sang-Heon Jeon
2026-07-27 9:45 ` [Intel-wired-lan] " Marcin Szycik
2026-07-30 11:10 ` [PATCH net-next v2 0/4] net: remove conditional returns " patchwork-bot+netdevbpf
2026-07-30 11:10 ` [Intel-wired-lan] " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260725150852.859188-4-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=arun.ramadoss@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.