From: Hans de Goede <hdegoede@redhat.com>
To: Armin Wolf <W_Armin@gmx.de>, markgross@kernel.org
Cc: jdelvare@suse.com, linux@roeck-us.net,
platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] platform/x86: dell-ddv: Fix temperature scaling
Date: Wed, 1 Mar 2023 13:19:55 +0100 [thread overview]
Message-ID: <cc25ee91-5197-b694-a6d6-e7d773afb5db@redhat.com> (raw)
In-Reply-To: <20230218115318.20662-2-W_Armin@gmx.de>
Hi,
On 2/18/23 12:53, Armin Wolf wrote:
> 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@gmx.de>
Thanks, I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
I'll rebase that branch once 6.3-rc1 is out and then push the rebased
patch to the fixes branch and include it in my next 6.3 fixes pull-req
to Linus.
Regards,
Hans
> ---
> Changes in v2:
> - Avoid unnecessary rounding
> ---
> drivers/platform/x86/dell/dell-wmi-ddv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c
> index eff4e9649faf..2750dee99c3e 100644
> --- a/drivers/platform/x86/dell/dell-wmi-ddv.c
> +++ b/drivers/platform/x86/dell/dell-wmi-ddv.c
> @@ -17,7 +17,6 @@
> #include <linux/kernel.h>
> #include <linux/hwmon.h>
> #include <linux/kstrtox.h>
> -#include <linux/math.h>
> #include <linux/math64.h>
> #include <linux/module.h>
> #include <linux/mutex.h>
> @@ -665,7 +664,8 @@ 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));
> + /* Use 2731 instead of 2731.5 to avoid unnecessary rounding */
> + return sysfs_emit(buf, "%d\n", value - 2731);
> }
>
> static ssize_t eppid_show(struct device *dev, struct device_attribute *attr, char *buf)
> --
> 2.30.2
>
next prev parent reply other threads:[~2023-03-01 12:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-18 11:53 [PATCH v2 1/2] platform/x86: dell-ddv: Fix cache invalidation on resume Armin Wolf
2023-02-18 11:53 ` [PATCH v2 2/2] platform/x86: dell-ddv: Fix temperature scaling Armin Wolf
2023-03-01 12:19 ` Hans de Goede [this message]
2023-02-28 13:21 ` [PATCH v2 1/2] platform/x86: dell-ddv: Fix cache invalidation on resume Armin Wolf
2023-03-01 12:15 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cc25ee91-5197-b694-a6d6-e7d773afb5db@redhat.com \
--to=hdegoede@redhat.com \
--cc=W_Armin@gmx.de \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox