From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Cédric Le Goater" <clg@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Arnaud Minier" <arnaud.minier@telecom-paris.fr>,
"Inès Varhol" <ines.varhol@telecom-paris.fr>,
qemu-devel@nongnu.org
Subject: Re: [PATCH for-9.0] tests/qtest: Fix STM32L4x5 GPIO test on 32-bit
Date: Fri, 29 Mar 2024 13:50:06 +0100 [thread overview]
Message-ID: <063e567d-2b88-4e4c-b293-5225d4084ded@linaro.org> (raw)
In-Reply-To: <20240329092747.298259-1-clg@redhat.com>
Hi Cédric, Thomas,
On 29/3/24 10:27, Cédric Le Goater 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;
> | ^
Any clue why this isn't this covered by CI?
>
> 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.minier@telecom-paris.fr>
> Cc: Inès Varhol <ines.varhol@telecom-paris.fr>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
> tests/qtest/stm32l4x5_gpio-test.c | 59 ++++++++++++++++++-------------
> 1 file changed, 35 insertions(+), 24 deletions(-)
next prev parent reply other threads:[~2024-03-29 12:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-29 9:27 [PATCH for-9.0] tests/qtest: Fix STM32L4x5 GPIO test on 32-bit Cédric Le Goater
2024-03-29 12:50 ` Philippe Mathieu-Daudé [this message]
2024-04-02 8:26 ` Cédric Le Goater
2024-04-02 9:06 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=063e567d-2b88-4e4c-b293-5225d4084ded@linaro.org \
--to=philmd@linaro.org \
--cc=arnaud.minier@telecom-paris.fr \
--cc=clg@redhat.com \
--cc=ines.varhol@telecom-paris.fr \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).