Hi Alex, On 5/10/21 16:17, Alex Deucher wrote: > On Sun, May 9, 2021 at 6:48 PM Gustavo A. R. Silva > <[email protected]> wrote: [..]
>> >> Bug: >> https://lore.kernel.org/dri-devel/[email protected]/ >> Fixes: 434fb1e7444a ("drm/radeon/nislands_smc.h: Replace one-element array >> with flexible-array member in struct NISLANDS_SMC_SWSTATE") >> Cc: [email protected] >> Reported-by: Christian Zigotzky <[email protected]> >> Tested-by: Christian Zigotzky <[email protected]> >> Link: >> https://lore.kernel.org/dri-devel/[email protected]/ >> Signed-off-by: Gustavo A. R. Silva <[email protected]> > > This seems like a lot of churn just to use flexible arrays. That > said, if static checkers are going to keep complaining about single > element arrays, I don't mind applying these patches since this code is > not likely to change. Applied. Thanks. This is not only about the one-element arrays. These fixes (together with commits 434fb1e7444a and 96e27e8d919e) allow us to fix more than a dozen of these out-of-bounds warnings: drivers/gpu/drm/radeon/ni_dpm.c:2521:20: warning: array subscript 1 is above array bounds of ‘NISLANDS_SMC_HW_PERFORMANCE_LEVEL[1]’ {aka ‘struct NISLANDS_SMC_HW_PERFORMANCE_LEVEL[1]’} [-Warray-bounds] 2521 | smc_state->levels[i].dpm2.MaxPS = | ~~~~~~~~~~~~~~~~~^~~ which should be fixed in order to globally enable -Warray-bounds. :) Thanks! -- Gustavo
