Re: [PATCH] ppc/pnv: Fix potential overflow in I2C model

2023-11-09 Thread Philippe Mathieu-Daudé
On 9/11/23 16:54, Cédric Le Goater wrote: On 11/9/23 16:02, Peter Maydell wrote: On Thu, 9 Nov 2023 at 08:06, Cédric Le Goater wrote: Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow because the expression is evaluated using 32-bit arithmetic and then used in a context e

Re: [PATCH] ppc/pnv: Fix potential overflow in I2C model

2023-11-09 Thread Peter Maydell
On Thu, 9 Nov 2023 at 15:54, Cédric Le Goater wrote: > > On 11/9/23 16:02, Peter Maydell wrote: > > On Thu, 9 Nov 2023 at 08:06, Cédric Le Goater wrote: > >> > >> Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow > >> because the expression is evaluated using 32-bit arithmeti

Re: [PATCH] ppc/pnv: Fix potential overflow in I2C model

2023-11-09 Thread Cédric Le Goater
On 11/9/23 16:02, Peter Maydell wrote: On Thu, 9 Nov 2023 at 08:06, Cédric Le Goater wrote: Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow because the expression is evaluated using 32-bit arithmetic and then used in a context expecting a uint64_t. Fixes: Coverity CID 1

Re: [PATCH] ppc/pnv: Fix potential overflow in I2C model

2023-11-09 Thread Peter Maydell
On Thu, 9 Nov 2023 at 08:06, Cédric Le Goater wrote: > > Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow > because the expression is evaluated using 32-bit arithmetic and then > used in a context expecting a uint64_t. > > Fixes: Coverity CID 1523918 > Cc: Glenn Miles > Sign

Re: [PATCH] ppc/pnv: Fix potential overflow in I2C model

2023-11-09 Thread Philippe Mathieu-Daudé
On 9/11/23 09:05, Cédric Le Goater wrote: Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow because the expression is evaluated using 32-bit arithmetic and then used in a context expecting a uint64_t. Fixes: Coverity CID 1523918 Cc: Glenn Miles Signed-off-by: Cédric Le Goat

[PATCH] ppc/pnv: Fix potential overflow in I2C model

2023-11-09 Thread Cédric Le Goater
Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow because the expression is evaluated using 32-bit arithmetic and then used in a context expecting a uint64_t. Fixes: Coverity CID 1523918 Cc: Glenn Miles Signed-off-by: Cédric Le Goater --- hw/ppc/pnv_i2c.c | 2 +- 1 file cha