From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Yang Zi <2959243019@qq.com>,
lorenzo@kernel.org, linux-iio@vger.kernel.org,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: humidity: hts221: fix division by zero in calibration data parsing
Date: Tue, 1 Sep 2026 02:35:44 +0100 [thread overview]
Message-ID: <20260901023544.0f65a55d@jic23-huawei> (raw)
In-Reply-To: <apUnohaFf1HaqWN9@ashevche-desk.local>
On Mon, 31 Aug 2026 10:05:06 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Mon, Aug 31, 2026 at 01:00:21AM +0100, Jonathan Cameron wrote:
> > On Wed, 26 Aug 2026 17:09:49 +0300
> > Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > > On Tue, Aug 25, 2026 at 05:21:10PM +0800, Yang Zi wrote:
>
> ...
>
> > > Do you have HW to test? Any fault injection perhaps?
> > > The problem with div-by-0 is that it's implementation defined, meaning
> > > that it's how compiler decides. Now, the question is, what will compiler
> > > do in the current code (no patch applied)?
> > >
> > Whilst all this is true, the code shouldn't be relying on any particular
> > behavior. So do we need to know?
>
> That's my point. If code relies on that, it should be spelled clearly in
> the commit message. Then we will deliberately break that (nasty and wrong)
> behaviour.
>
Ah. Got you. So a statement that the condition (probably) never occurs in practice
should do the job here by side stepping that question.
> > Reality is the hardware is almost certainly never returning values where this
> > is true.
>
next prev parent reply other threads:[~2026-09-01 1:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 9:21 [PATCH] iio: humidity: hts221: fix division by zero in calibration data parsing Yang Zi
2026-08-25 9:39 ` Joshua Crofts
2026-08-31 0:17 ` Jonathan Cameron
2026-08-26 14:09 ` Andy Shevchenko
2026-08-31 0:00 ` Jonathan Cameron
2026-08-31 7:05 ` Andy Shevchenko
2026-09-01 1:35 ` Jonathan Cameron [this message]
2026-09-01 6:53 ` Andy Shevchenko
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=20260901023544.0f65a55d@jic23-huawei \
--to=jic23@kernel.org \
--cc=2959243019@qq.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nuno.sa@analog.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