Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-09 Thread Michael Ellerman
christophe leroy writes: > Le 01/10/2018 à 18:44, Dan Carpenter a écrit : >> The "count < sizeof(struct os_area_db)" comparison is type promoted to >> size_t so negative values of "count" are treated as very high values and >> we accidentally return success instead of a negative error code. >> >

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread Geoff Levand
On 10/01/2018 09:44 AM, Dan Carpenter wrote: > The "count < sizeof(struct os_area_db)" comparison is type promoted to > size_t so negative values of "count" are treated as very high values and > we accidentally return success instead of a negative error code. > > This doesn't really change runtime

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread Dan Carpenter
On Mon, Oct 01, 2018 at 10:02:54PM +0300, Dan Carpenter wrote: > On Mon, Oct 01, 2018 at 08:22:01PM +0200, christophe leroy wrote: > > > > > > Le 01/10/2018 à 18:44, Dan Carpenter a écrit : > > > The "count < sizeof(struct os_area_db)" comparison is type promoted to > > > size_t so negative value

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread Dan Carpenter
On Mon, Oct 01, 2018 at 08:22:01PM +0200, christophe leroy wrote: > > > Le 01/10/2018 à 18:44, Dan Carpenter a écrit : > > The "count < sizeof(struct os_area_db)" comparison is type promoted to > > size_t so negative values of "count" are treated as very high values and > > we accidentally return

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread christophe leroy
Le 01/10/2018 à 18:44, Dan Carpenter a écrit : The "count < sizeof(struct os_area_db)" comparison is type promoted to size_t so negative values of "count" are treated as very high values and we accidentally return success instead of a negative error code. This doesn't really change runtime mu

[PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread Dan Carpenter
The "count < sizeof(struct os_area_db)" comparison is type promoted to size_t so negative values of "count" are treated as very high values and we accidentally return success instead of a negative error code. This doesn't really change runtime much but it fixes a static checker warning. Signed-of