Re: [PATCH] ibex_uart: fix XOR-as-pow

2020-06-24 Thread Philippe Mathieu-Daudé
On 6/24/20 8:33 AM, Paolo Bonzini wrote: > On 23/06/20 22:07, Eric Blake wrote: >>> >>> uint64_t baud = ((value & UART_CTRL_NCO) >> 16); >>>   baud *= 1000; >>> -    baud /= 2 ^ 20; >>> +    baud >>= 20; >> >> Dividing by 1M instead of 22 seems much more log

Re: [PATCH] ibex_uart: fix XOR-as-pow

2020-06-23 Thread Paolo Bonzini
On 23/06/20 22:07, Eric Blake wrote: >> >> uint64_t baud = ((value & UART_CTRL_NCO) >> 16); >>   baud *= 1000; >> -    baud /= 2 ^ 20; >> +    baud >>= 20; > > Dividing by 1M instead of 22 seems much more logical, indeed :) Based on the spec, the "* 1000"

Re: [PATCH] ibex_uart: fix XOR-as-pow

2020-06-23 Thread Alistair Francis
On Tue, Jun 23, 2020 at 1:07 PM Paolo Bonzini wrote: > > The xor-as-pow warning in clang actually detected a genuine bug. > Fix it. > > Signed-off-by: Paolo Bonzini > --- > hw/char/ibex_uart.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/char/ibex_uart.c b/hw/char/

Re: [PATCH] ibex_uart: fix XOR-as-pow

2020-06-23 Thread Peter Maydell
cc'ing Alistair as listed maintainer for the device... On Tue, 23 Jun 2020 at 21:07, Paolo Bonzini wrote: > > The xor-as-pow warning in clang actually detected a genuine bug. > Fix it. > > Signed-off-by: Paolo Bonzini > --- > hw/char/ibex_uart.c | 2 +- > 1 file changed, 1 insertion(+), 1 delet

Re: [PATCH] ibex_uart: fix XOR-as-pow

2020-06-23 Thread Eric Blake
On 6/23/20 2:54 PM, Paolo Bonzini wrote: The xor-as-pow warning in clang actually detected a genuine bug. Fix it. Signed-off-by: Paolo Bonzini --- 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 3e0dd9968

[PATCH] ibex_uart: fix XOR-as-pow

2020-06-23 Thread Paolo Bonzini
The xor-as-pow warning in clang actually detected a genuine bug. Fix it. Signed-off-by: Paolo Bonzini --- 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.