Re: [PATCH][next] ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch()

From: Tony Lindgren
Date: Wed Jun 14 2023 - 04:08:51 EST


* Gustavo A. R. Silva <gustavoars@xxxxxxxxxx> [230608 07:11]:
> If function pwrdm_read_prev_pwrst() returns -EINVAL, we will end
> up accessing array pwrdm->state_counter through negative index
> -22. This is wrong and the compiler is legitimately warning us
> about this potential problem.
>
> Fix this by sanity checking the value stored in variable _prev_
> before accessing array pwrdm->state_counter.
>
> Address the following -Warray-bounds warning:
> arch/arm/mach-omap2/powerdomain.c:178:45: warning: array subscript -22 is below array bounds of 'unsigned int[4]' [-Warray-bounds]

Thanks applying into omap-for-v6.5/cleanup, seems this can wait
for the merge window.

Regards,

Tony