[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABxCQKthnVk4GOMu5M8Q8PbioO72AaiHSfbu-SB2KjuOz4ZU5A@mail.gmail.com>
Date: Fri, 9 Feb 2024 09:15:04 +0900
From: Vishnu Sankar <vishnuocv@...il.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Hans de Goede <hdegoede@...hat.com>, platform-driver-x86@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>, vsankar@...ovo.com,
Mark Pearson <mpearson-lenovo@...ebb.ca>
Subject: Re: [PATCH] Fix to correct wrong temp reporting on some ThinkPads
On Fri, Feb 9, 2024 at 12:11 AM Ilpo Järvinen
<ilpo.jarvinen@...ux.intel.com> wrote:
>
> On Thu, 8 Feb 2024, Vishnu Sankar wrote:
>
> > Thanks a lot for the review.
> > And sorry for the delay in response.
>
> Small improvements to my earlier version below now that I reread it.
>
> > On Tue, Feb 6, 2024 at 8:03 PM Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com> wrote:
> >
> > > @@ -6174,6 +6191,21 @@ static int thermal_get_sensor(int idx, s32 *value)
> ...
> > A code reader would be served much better if this convoluted logic is
> > simplied to:
> >
> > case TPACPI_THERMAL_TPEC_12:
> > if (idx >= 12)
> > return -EINVAL;
> >
> > if (idx <= 7)
>
> if (idx < 8) <- to match idx - 8
Acked
>
> > ec_offset = TP_EC_THERMAL_TMP0_NS + idx;
> > else
> > ec_offset = TP_EC_THERMAL_TMP8_NS + (idx - 8);
> >
> > if (!acpi_ec_read(ec_offset, &tmp))
> > return -EIO;
> >
> > *value = tmp * 1000;
>
> 1000 should likely be something from linux/units.h.
Got it.
Will use KILO.
>
>
> --
> i.
--
Regards,
Vishnu Sankar
+817015150407 (Japan)
Powered by blists - more mailing lists