qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] ibex_uart: fix XOR-as-pow
Date: Tue, 23 Jun 2020 16:26:55 -0700	[thread overview]
Message-ID: <CAKmqyKP4c1qBcWYP3R1bXB8xCR-6GBqwRe6qEYHkMNBjH3LVnA@mail.gmail.com> (raw)
In-Reply-To: <20200623195441.14646-1-pbonzini@redhat.com>

On Tue, Jun 23, 2020 at 1:07 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The xor-as-pow warning in clang actually detected a genuine bug.
> Fix it.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/char/ibex_uart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/char/ibex_uart.c b/hw/char/ibex_uart.c
> index 3e0dd9968e..45cd724998 100644
> --- a/hw/char/ibex_uart.c
> +++ b/hw/char/ibex_uart.c
> @@ -331,7 +331,7 @@ static void ibex_uart_write(void *opaque, hwaddr addr,
>          if (value & UART_CTRL_NCO) {
>              uint64_t baud = ((value & UART_CTRL_NCO) >> 16);
>              baud *= 1000;
> -            baud /= 2 ^ 20;
> +            baud >>= 20;

Whoops, that is clearly wrong. Thanks for catching this.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

>
>              s->char_tx_time = (NANOSECONDS_PER_SECOND / baud) * 10;
>          }
> --
> 2.26.2
>
>


      parent reply	other threads:[~2020-06-23 23:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 19:54 [PATCH] ibex_uart: fix XOR-as-pow Paolo Bonzini
2020-06-23 20:07 ` Eric Blake
2020-06-24  6:33   ` Paolo Bonzini
2020-06-24  9:25     ` Philippe Mathieu-Daudé
2020-06-23 20:33 ` Peter Maydell
2020-06-23 23:26 ` Alistair Francis [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=CAKmqyKP4c1qBcWYP3R1bXB8xCR-6GBqwRe6qEYHkMNBjH3LVnA@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).