lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230213182215.53703-2-W_Armin@gmx.de>
Date:   Mon, 13 Feb 2023 19:22:15 +0100
From:   Armin Wolf <W_Armin@....de>
To:     hdegoede@...hat.com, markgross@...nel.org
Cc:     jdelvare@...e.com, linux@...ck-us.net,
        platform-driver-x86@...r.kernel.org, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] platform/x86: dell-ddv: Fix temperature scaling

After using the built-in UEFI hardware diagnostics to compare
the measured battery temperature, i noticed that the temperature
is actually expressed in tenth degree kelvin, similar to the
SBS-Data standard. For example, a value of 2992 is displayed as
26 degrees celsius.
Fix the scaling so that the correct values are being displayed.

Tested on a Dell Inspiron 3505.

Fixes: a77272c16041 ("platform/x86: dell: Add new dell-wmi-ddv driver")
Signed-off-by: Armin Wolf <W_Armin@....de>
---
 drivers/platform/x86/dell/dell-wmi-ddv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c
index 58f996b3b374..efa860dbff6c 100644
--- a/drivers/platform/x86/dell/dell-wmi-ddv.c
+++ b/drivers/platform/x86/dell/dell-wmi-ddv.c
@@ -662,7 +662,7 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr, char
 	if (ret < 0)
 		return ret;

-	return sysfs_emit(buf, "%d\n", DIV_ROUND_CLOSEST(value, 10));
+	return sysfs_emit(buf, "%d\n", DIV_ROUND_CLOSEST(value * 10 - 27315, 10));
 }

 static ssize_t eppid_show(struct device *dev, struct device_attribute *attr, char *buf)
--
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ