From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <ahmad@a3f.at>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] fixup! commands: add new bthread test command
Date: Wed, 17 Mar 2021 09:34:33 +0100 [thread overview]
Message-ID: <20210317083433.GW23724@pengutronix.de> (raw)
In-Reply-To: <20210316082034.1740511-1-ahmad@a3f.at>
On Tue, Mar 16, 2021 at 09:20:34AM +0100, Ahmad Fatoum wrote:
> GCC whines about casting int to pointer, which aren't always the same
> size in barebox. Use long instead to avoid the warning.
>
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
> commands/bthread.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/commands/bthread.c b/commands/bthread.c
> index 05dfa68cc597..964a1044c58b 100644
> --- a/commands/bthread.c
> +++ b/commands/bthread.c
> @@ -66,15 +66,15 @@ static int bthread_isolated_time(void)
> static int bthread_printer(void *arg)
> {
> volatile u64 start;
> - volatile int i = 0;
> + volatile unsigned long i = 0;
> start = get_time_ns();
>
> while (!bthread_should_stop()) {
> if (!is_timeout_non_interruptible(start, 225 * MSECOND))
> continue;
>
> - if ((long)arg == i++)
> - printf("%s yield #%d\n", bthread_name(current), i);
> + if ((unsigned long)arg == i++)
> + printf("%s yield #%lu\n", bthread_name(current), i);
> start = get_time_ns();
> }
>
> @@ -87,14 +87,14 @@ static int bthread_spawner(void *arg)
> {
> struct bthread *bthread[4];
> volatile u64 start;
> - volatile int i = 0;
> + volatile unsigned long i = 0;
> int ret = 0;
> int ecode;
>
> start = get_time_ns();
>
> for (i = 0; i < ARRAY_SIZE(bthread); i++) {
> - bthread[i] = bthread_run(bthread_printer, (void *)i,
> + bthread[i] = bthread_run(bthread_printer, (void *)(long)i,
> "%s-bthread%u", bthread_name(current), i+1);
> if (!bthread[i]) {
> ret = -ENOMEM;
> --
> 2.30.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2021-03-17 8:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 8:20 Ahmad Fatoum
2021-03-17 8:34 ` Sascha Hauer [this message]
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=20210317083433.GW23724@pengutronix.de \
--to=sha@pengutronix.de \
--cc=ahmad@a3f.at \
--cc=barebox@lists.infradead.org \
/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