On Fri, 29 Mar 2024 at 09:28, Cédric Le Goater <c...@redhat.com> wrote:
>
> The test mangles the GPIO address and the pin number in the
> qtest_add_data_func data parameter. Doing so, it assumes that the host
> pointer size is always 64-bit, which breaks on 32-bit :
>
> ../tests/qtest/stm32l4x5_gpio-test.c: In function ‘test_gpio_output_mode’:
> ../tests/qtest/stm32l4x5_gpio-test.c:272:25: error: cast from pointer to 
> integer of different size [-Werror=pointer-to-int-cast]
>   272 |     unsigned int pin = ((uint64_t)data) & 0xF;
>       |                         ^
> ../tests/qtest/stm32l4x5_gpio-test.c:273:22: error: cast from pointer to 
> integer of different size [-Werror=pointer-to-int-cast]
>   273 |     uint32_t gpio = ((uint64_t)data) >> 32;
>       |                      ^
>
> To fix, improve the mangling of the GPIO address and pin number fields
> by using GPIO_SIZE so that the resulting value fits in a 32-bit pointer.
> While at it, include some helpers to hide the details.
>
> Cc: Arnaud Minier <arnaud.min...@telecom-paris.fr>
> Cc: Inès Varhol <ines.var...@telecom-paris.fr>
> Signed-off-by: Cédric Le Goater <c...@redhat.com>



Applied to target-arm.next, thanks.

-- PMM

Reply via email to