Skip to content

Commit c8d7fd0

Browse files
committed
ibex_uart: fix XOR-as-pow
The xor-as-pow warning in clang actually detected a genuine bug. Fix it. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent f983ff9 commit c8d7fd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hw/char/ibex_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static void ibex_uart_write(void *opaque, hwaddr addr,
331331
if (value & UART_CTRL_NCO) {
332332
uint64_t baud = ((value & UART_CTRL_NCO) >> 16);
333333
baud *= 1000;
334-
baud /= 2 ^ 20;
334+
baud >>= 20;
335335

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

0 commit comments

Comments
 (0)