public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: Kirkwood: Fix tv sec/usec normalization in kwboot
Date: Wed, 28 Apr 2021 07:22:25 +0200	[thread overview]
Message-ID: <16590b7c-746d-eb33-e383-5ddf596ea356@denx.de> (raw)
In-Reply-To: <CAK7p70jMF7ShKvckopPGXeoC3BOkDJrpBrjSo-Wbe5Sfrh7y1A@mail.gmail.com>

On 27.04.21 21:57, Dagan Martinez wrote:
>  From 328c559acf6872bf0cbafe7fbb881748d5c753fb Mon Sep 17 00:00:00 2001
> From: Property404 <dmartinez@starry.com>
> Date: Tue, 27 Apr 2021 15:48:31 -0400
> Subject: [PATCH] Kirkwood: Fix tv sec/usec normalization in kwboot
> 
> `kwboot.c` had an issue where it failed to normalize the `tv` struct in
> the case where the `tv_usec` field was 1000000, ie one second.
> 
> This caused issues on Fedora Linux 34, where `select` would return
> `EINVAL`, preventing kwboot from communicating with the board.
> 
> Signed-off-by: Property404 <dmartinez@starry.com>
> ---
>   tools/kwboot.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/kwboot.c b/tools/kwboot.c
> index 4be094c9c8..5d5d501d36 100644
> --- a/tools/kwboot.c
> +++ b/tools/kwboot.c
> @@ -167,7 +167,7 @@ kwboot_tty_recv(int fd, void *buf, size_t len, int timeo)
> 
>       tv.tv_sec = 0;
>       tv.tv_usec = timeo * 1000;
> -    if (tv.tv_usec > 1000000) {
> +    if (tv.tv_usec >= 1000000) {
>           tv.tv_sec += tv.tv_usec / 1000000;
>           tv.tv_usec %= 1000000;
>       }
> 

Reviewed-by: Stefan Roese <sr@denx.de>

BTW: I'm not 100% sure, but my understanding is that it is preferred (or
even required) to provide a "real name" in the tags. So it might be that
"Property404" is not enough here.

Thanks,
Stefan

       reply	other threads:[~2021-04-28  5:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAK7p70jMF7ShKvckopPGXeoC3BOkDJrpBrjSo-Wbe5Sfrh7y1A@mail.gmail.com>
2021-04-28  5:22 ` Stefan Roese [this message]
2021-04-28 11:24   ` Kirkwood: Fix tv sec/usec normalization in kwboot Dagan Martinez
2021-04-28 14:44     ` Stefan Roese
2021-04-29 12:03       ` Dagan Martinez
2021-04-30  7:24         ` Stefan Roese

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=16590b7c-746d-eb33-e383-5ddf596ea356@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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