From: Guenter Roeck <linux@roeck-us.net>
To: Charles Keepax <ckeepax@opensource.cirrus.com>,
Zhu Jun <zhujun2@cmss.chinamobile.com>
Cc: rf@opensource.cirrus.com, patches@opensource.cirrus.com,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (lochnagar) Avoid oversized shifts for zero readings
Date: Mon, 9 Nov 2026 07:11:04 -0800 [thread overview]
Message-ID: <59a7e61f-ce9c-4bba-b2c8-6e19b3d84081@roeck-us.net> (raw)
In-Reply-To: <avGsCiZK7ChHaHx2@opensource.cirrus.com>
On 11/9/26 03:18, Charles Keepax wrote:
> On Mon, Nov 09, 2026 at 05:33:32PM +0800, Zhu Jun wrote:
>> From: zhujun <zhujun2@cmss.chinamobile.com>
>>
>> A zero IEEE754 reading gives exp = -150 in float_to_long(). Both shifts
>> in the rounding expression then exceed the width of u64. UBSAN reports a
>> shift exponent of 149, and the conversion can return a nonzero reading.
>>
>> Return zero when the required right shift is at least 64 bits. With the
>> supported precisions, the scaled mantissa is too small to round up in
>> this case.
>>
>> Fixes: 4cdb56214746 ("hwmon: lochnagar: Add Lochnagar 2 hardware monitoring driver")
>> ---
>> 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.
>
> Yeah afraid the human submitter will need to add their
> Signed-off-by :-)
>
... and remove the AI comment that it needs to be added. Unfortunately
that didn't happen, suggesting that the human submitter didn't even read
those comments, making it questionable if they were actually reviewed.
I can not apply any of the patches due to the missing signature,
making them just noise. Too bad :-(.
In the case of this patch, unless I am missing something, it isn't really
needed because the large shift causes the result to be 0 anyway.
Guenter
next prev parent reply other threads:[~2026-11-09 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 9:33 Zhu Jun
2026-11-09 11:18 ` Charles Keepax
2026-11-09 15:11 ` Guenter Roeck [this message]
2026-11-11 6:49 Zhu Jun
2026-11-11 9:32 ` Charles Keepax
2026-11-11 22:34 ` Guenter Roeck
2026-11-12 2:19 ` Zhu Jun
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=59a7e61f-ce9c-4bba-b2c8-6e19b3d84081@roeck-us.net \
--to=linux@roeck-us.net \
--cc=ckeepax@opensource.cirrus.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=rf@opensource.cirrus.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®