From 434e0c060bef5ca783a37327ea335ddd28b4313b Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:40 +0100 Subject: [PATCH] Revert "hwmon: (nct6775-core) Fix underflows seen when writing limit attributes" This reverts commit 8233145bc9242a819bad4497e27e473f8f7f76aa. --- drivers/hwmon/nct6775.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index 3645a19cd..5bd15622a 100755 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c @@ -2374,7 +2374,7 @@ store_temp_offset(struct device *dev, struct device_attribute *attr, if (err < 0) return err; - val = DIV_ROUND_CLOSEST(clamp_val(val, -128000, 127000), 1000); + val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127); mutex_lock(&data->update_lock); data->temp_offset[nr] = val;