linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Guenter Roeck <linux@roeck-us.net>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-kernel@vger.kernel.org
Cc: sparclinux@vger.kernel.org, linux-parisc@vger.kernel.org,
	linux-hwmon@vger.kernel.org, intel-xe@lists.freedesktop.org
Subject: Re: Build regressions/improvements in v6.8-rc2
Date: Tue, 30 Jan 2024 08:49:32 +0100	[thread overview]
Message-ID: <90cd0f1a-29c0-4c6f-9efd-92b69da194c0@gmx.de> (raw)
In-Reply-To: <56b9c222-4e97-4eda-89af-3e0d0c39acb2@roeck-us.net>

On 1/29/24 15:58, Guenter Roeck wrote:
> On 1/29/24 03:06, Geert Uytterhoeven wrote:
> [ ... ]
>> parisc-gcc1[23]/parisc-{allmod,def}config
>>
>>    + /kisskb/src/drivers/hwmon/pc87360.c: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]:  => 383:51
>>
>
> The "fix" for this problem would be similar to commit 4265eb062a73 ("hwmon: (pc87360)
> Bounds check data->innr usage"). The change would be something like
>
> -               for (i = 0; i < data->tempnr; i++) {
> +               for (i = 0; i < min(data->tempnr, ARRAY_SIZE(data->temp_max)); i++) {
>
> but that would be purely random because the loop accesses several arrays
> indexed with i, and tempnr is never >= ARRAY_SIZE(data->temp_max).
> I kind of resist making such changes to the code just because the compiler
> is clueless.

I agree with your analysis.
But I'm wondering why this warning just seem to appear on parisc.
I would expect gcc on other platforms to complain as well ?!?

Helge

> Are we sprinkling the kernel code with code like this to make the compiler happy ?
>
> Guenter
>
>


  reply	other threads:[~2024-01-30  7:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29  1:13 Linux 6.8-rc2 Linus Torvalds
2024-01-29 10:49 ` Build regressions/improvements in v6.8-rc2 Geert Uytterhoeven
2024-01-29 11:06   ` Geert Uytterhoeven
2024-01-29 14:58     ` Guenter Roeck
2024-01-30  7:49       ` Helge Deller [this message]
2024-01-30  8:02         ` Sam James
2024-01-30 16:38         ` Guenter Roeck
2024-01-29 19:39 ` Linux 6.8-rc2 Guenter Roeck

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=90cd0f1a-29c0-4c6f-9efd-92b69da194c0@gmx.de \
    --to=deller@gmx.de \
    --cc=geert@linux-m68k.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=sparclinux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).