On 11 July 2017 at 13:46,  <no-re...@patchew.org> wrote:
> /var/tmp/patchew-tester-tmp-e38by36j/src/hw/char/cmsdk-apb-uart.c: In 
> function ‘uart_read’:
> /var/tmp/patchew-tester-tmp-e38by36j/src/hw/char/cmsdk-apb-uart.c:164:20: 
> error: array subscript is above array bounds [-Werror=array-bounds]
>          r = uart_id[offset / 4 - A_PID4];
>              ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> /var/tmp/patchew-tester-tmp-e38by36j/src/rules.mak:66: recipe for target 
> 'hw/char/cmsdk-apb-uart.o' failed
> make: *** [hw/char/cmsdk-apb-uart.o] Error 1
> make: *** Waiting for unfinished jobs....

The compiler is correct here -- should be (offset - A_PID4) / 4,
since the A_* values are the register offsets and all multiples of 4.

thanks
-- PMM

Reply via email to