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

2023-11-09 Thread Philippe Mathieu-Daudé
On 9/11/23 18:15, 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. While we are at it, introduce a PNV_I2C_MAX_BUSSES constant and check the

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

2023-11-09 Thread Miles Glenn
On Thu, 2023-11-09 at 18:15 +0100, 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. > > While we are at it, introduce a PNV_I2C_MAX_BUS

[PATCH v2] 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. While we are at it, introduce a PNV_I2C_MAX_BUSSES constant and check the number of busses at realize time. Fixes: Co