2023-11-21 22:50:28

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning after merge of the kspp-gustavo tree

Hi all,

After merging the kspp-gustavo tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

In function 'aspeed_create_fan_tach_channel',
inlined from 'aspeed_create_fan' at drivers/hwmon/aspeed-pwm-tacho.c:877:2,
inlined from 'aspeed_pwm_tacho_probe' at drivers/hwmon/aspeed-pwm-tacho.c:936:9:
drivers/hwmon/aspeed-pwm-tacho.c:751:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
751 | priv->fan_tach_ch_source[index] = pwm_source;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
drivers/hwmon/aspeed-pwm-tacho.c: In function 'aspeed_pwm_tacho_probe':
drivers/hwmon/aspeed-pwm-tacho.c:193:12: note: at offset [48, 255] into destination object 'fan_tach_ch_source' of size 16
193 | u8 fan_tach_ch_source[16];
| ^~~~~~~~~~~~~~~~~~

Exposed by commit

1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally")

This is with your tree on top of Linus' tree (and some fix patches but
nothing that obviously touches anything relevent) and CONFIG_WERROR
not set.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2023-11-21 23:19:51

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the kspp-gustavo tree


On 11/21/23 16:50, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp-gustavo tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> In function 'aspeed_create_fan_tach_channel',
> inlined from 'aspeed_create_fan' at drivers/hwmon/aspeed-pwm-tacho.c:877:2,
> inlined from 'aspeed_pwm_tacho_probe' at drivers/hwmon/aspeed-pwm-tacho.c:936:9:
> drivers/hwmon/aspeed-pwm-tacho.c:751:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
> 751 | priv->fan_tach_ch_source[index] = pwm_source;
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
> drivers/hwmon/aspeed-pwm-tacho.c: In function 'aspeed_pwm_tacho_probe':
> drivers/hwmon/aspeed-pwm-tacho.c:193:12: note: at offset [48, 255] into destination object 'fan_tach_ch_source' of size 16
> 193 | u8 fan_tach_ch_source[16];
> | ^~~~~~~~~~~~~~~~~~
>
> Exposed by commit
>
> 1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally")
>
> This is with your tree on top of Linus' tree (and some fix patches but
> nothing that obviously touches anything relevent) and CONFIG_WERROR
> not set.
>

Hi Stephen,

The fix for this issue is also in linux-next already:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=72cfe7a99c9ea1e64fc532f4f05c99991858dc34

Thanks!
--
Gustavo