From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH] ibex_uart: fix XOR-as-pow
Date: Tue, 23 Jun 2020 15:54:41 -0400 [thread overview]
Message-ID: <20200623195441.14646-1-pbonzini@redhat.com> (raw)
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;
s->char_tx_time = (NANOSECONDS_PER_SECOND / baud) * 10;
}
--
2.26.2
next reply other threads:[~2020-06-23 20:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 19:54 Paolo Bonzini [this message]
2020-06-23 20:07 ` [PATCH] ibex_uart: fix XOR-as-pow 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
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=20200623195441.14646-1-pbonzini@redhat.com \
--to=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).