[PATCH 31/36] thermal/drivers/k3_bandgap: remove conditional return with no effect
From: Sang-Heon Jeon
Date: Thu Jul 23 2026 - 15:00:48 EST
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@xxxxxxxxx>
---
drivers/thermal/k3_bandgap.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c
index 678d6ed711b5..766fab7bcf1b 100644
--- a/drivers/thermal/k3_bandgap.c
+++ b/drivers/thermal/k3_bandgap.c
@@ -141,13 +141,8 @@ static int k3_bgp_read_temp(struct k3_thermal_data *devdata,
static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
{
struct k3_thermal_data *data = thermal_zone_device_priv(tz);
- int ret = 0;
- ret = k3_bgp_read_temp(data, temp);
- if (ret)
- return ret;
-
- return ret;
+ return k3_bgp_read_temp(data, temp);
}
static const struct thermal_zone_device_ops k3_of_thermal_ops = {
--
2.43.0