From: Joshua Crofts <crofts@kernel.org>
To: Zhu Jun <zhujun2@cmss.chinamobile.com>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: temperature: mcp9600: Bound thresholds before scaling
Date: Tue, 10 Nov 2026 00:01:08 +0100 [thread overview]
Message-ID: <20261110000108.2f3ce0a5@systembl0wer> (raw)
In-Reply-To: <20261109093518.5418-1-zhujun2@cmss.chinamobile.com>
On Mon, 9 Nov 2026 17:35:17 +0800
Zhu Jun <zhujun2@cmss.chinamobile.com> wrote:
> From: zhujun <zhujun2@cmss.chinamobile.com>
>
> mcp9600_write_thresh() multiplies the integer part by 1000000 before
> clamping to the supported temperature range. The multiplication can
> overflow int, so a request such as 3000 degrees can select the lower
> threshold instead of the upper threshold.
>
> Clamp the integer part to the hot-junction range before scaling. Keep
> the existing final clamp for fractional values and the narrower cold-
> junction range.
>
> Fixes: dea750f8015b ("iio: temperature: mcp9600: add threshold events support")
> ---
> Validation: x86-64 and i386 driver objects built with W=1.
> Source-extracted boundary tests passed on 32-bit and 64-bit;
> the corresponding test fails on the base revision. I/O is mocked.
> No physical sensor hardware or booted-kernel test was available.
> OpenAI Codex assisted analysis, code, tests and changelog drafting.
> The human submitter must review and add their Signed-off-by.
Just noticed this sentence... I guess this was copied 1:1 from Codex...
--
Joshua Crofts
prev parent reply other threads:[~2026-11-09 23:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 9:35 [PATCH] iio: temperature: mcp9600: Bound thresholds before scaling Zhu Jun
2026-11-09 10:04 ` Joshua Crofts
2026-11-09 22:44 ` Andy Shevchenko
2026-11-09 23:01 ` Joshua Crofts [this message]
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=20261110000108.2f3ce0a5@systembl0wer \
--to=crofts@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=zhujun2@cmss.chinamobile.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.