public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Vishnu Sankar <vishnuocv@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>,
	vsankar@lenovo.com,  Mark Pearson <mpearson-lenovo@squebb.ca>
Subject: Re: [PATCH] Fix to correct wrong temp reporting on some ThinkPads
Date: Thu, 8 Feb 2024 17:11:23 +0200 (EET)	[thread overview]
Message-ID: <2f280707-7250-4bb2-460c-5f8a02208179@linux.intel.com> (raw)
In-Reply-To: <CABxCQKvtgwxS_DU2U-LNrPiqHF4+y2YPkMgP4-nS6U3ccp8M7w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

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@linux.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

>                               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.


-- 
 i.

  parent reply	other threads:[~2024-02-08 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 18:07 [PATCH] Fix to correct wrong temp reporting on some ThinkPads Vishnu Sankar
2024-02-06 11:03 ` Ilpo Järvinen
     [not found]   ` <CABxCQKvtgwxS_DU2U-LNrPiqHF4+y2YPkMgP4-nS6U3ccp8M7w@mail.gmail.com>
2024-02-08 15:11     ` Ilpo Järvinen [this message]
2024-02-09  0:15       ` Vishnu Sankar

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=2f280707-7250-4bb2-460c-5f8a02208179@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=vishnuocv@gmail.com \
    --cc=vsankar@lenovo.com \
    /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