summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2025-02-05 12:34:13 -0800
committerGuenter Roeck <linux@roeck-us.net>2026-08-10 08:59:42 -0700
commit9fcd738d131d5e5fbd04bf3720751a2d73a7cea8 (patch)
tree8e273375f48b28a510b4df9b772274300dc78302
parentbd300460cee457c50a16a42654d6de4c85562785 (diff)
hwmon: (pmbus/mp2975) Eliminate dead code
Coverity reports dead code in mp2975_data2reg_linear11(). Code analysis shows that the parameter passed to the function is always non-negative. This means that negative values do not need to be handled, and the associated variable and conditional code can be removed. No functional impact or change. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/pmbus/mp2975.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c
index 5393f7aeea0f..8e5193933ceb 100644
--- a/drivers/hwmon/pmbus/mp2975.c
+++ b/drivers/hwmon/pmbus/mp2975.c
@@ -176,7 +176,6 @@ mp2975_vid2direct(int vrf, int val)
static u16 mp2975_data2reg_linear11(s64 val)
{
s16 exponent = 0, mantissa;
- bool negative = false;
/* simple case */
if (val == 0)
@@ -196,10 +195,6 @@ static u16 mp2975_data2reg_linear11(s64 val)
/* Convert mantissa from milli-units to units */
mantissa = clamp_val(DIV_ROUND_CLOSEST_ULL(val, 1000), 0, 0x3ff);
- /* restore sign */
- if (negative)
- mantissa = -mantissa;
-
/* Convert to 5 bit exponent, 11 bit mantissa */
return (mantissa & 0x7ff) | ((exponent << 11) & 0xf800);
}