[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241205213315.3073207-1-karprzy7@gmail.com>
Date: Thu, 5 Dec 2024 22:33:15 +0100
From: Karol Przybylski <karprzy7@...il.com>
To: karprzy7@...il.com,
skhan@...uxfoundation.org,
jbrunet@...libre.com,
jdelvare@...e.com,
linux@...ck-us.net
Cc: linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] hwmon: tps25990: Fix unreachable code in tps25990_read_word_data
The tps25990_read_word_data function contains a block of unreachable code caused by the syntactic structure in the PMBUS_VIRT_READ_IIN_MAX case.
Specifically, the return TPS25990_READ_IIN_PEAK; statement immediately exits the function, making the next lines unreachable.
This patch removes the return statement, leaving the expected handling.
Discovered in coverity: CID 1602227
Signed-off-by: Karol Przybylski <karprzy7@...il.com>
---
drivers/hwmon/pmbus/tps25990.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/hwmon/pmbus/tps25990.c b/drivers/hwmon/pmbus/tps25990.c
index cc0f5c7ce..0d2655e69 100644
--- a/drivers/hwmon/pmbus/tps25990.c
+++ b/drivers/hwmon/pmbus/tps25990.c
@@ -130,7 +130,6 @@ static int tps25990_read_word_data(struct i2c_client *client,
break;
case PMBUS_VIRT_READ_IIN_MAX:
- return TPS25990_READ_IIN_PEAK;
ret = pmbus_read_word_data(client, page, phase,
TPS25990_READ_IIN_PEAK);
break;
--
2.34.1
Powered by blists - more mailing lists