qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ibex_uart: fix XOR-as-pow
@ 2020-06-23 19:54 Paolo Bonzini
  2020-06-23 20:07 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Paolo Bonzini @ 2020-06-23 19:54 UTC (permalink / raw)
  To: qemu-devel

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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-06-24  9:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).