RE: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread David Laight
From: Julia Lawall > On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: > > > Hi Julia, > > > > On Wed, Jun 4, 2014 at 1:00 PM, Julia Lawall wrote: > > > OK, thanks. I was only looking at the C code. > > > > > > But the C code contains a loop that is followed by: > > > > > > if (!size) > > >

Re: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: > Hi Julia, > > On Wed, Jun 4, 2014 at 1:00 PM, Julia Lawall wrote: > > OK, thanks. I was only looking at the C code. > > > > But the C code contains a loop that is followed by: > > > > if (!size) > > return result; > >

Re: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Geert Uytterhoeven
Hi Julia, On Wed, Jun 4, 2014 at 1:00 PM, Julia Lawall wrote: > OK, thanks. I was only looking at the C code. > > But the C code contains a loop that is followed by: > > if (!size) > return result; > tmp = *p; > > found_first: > tmp |= ~0UL << size; >

Re: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: > Hi Julia, > > On Wed, Jun 4, 2014 at 11:52 AM, Julia Lawall wrote: > >> Maybe the documented return code should be changed to allow for the > >> existing behaviour. > > > > Sorry, I'm not sure to understand what you suggest here. > > include/asm-g

Re: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Geert Uytterhoeven
Hi Julia, On Wed, Jun 4, 2014 at 11:52 AM, Julia Lawall wrote: >> Maybe the documented return code should be changed to allow for the >> existing behaviour. > > Sorry, I'm not sure to understand what you suggest here. include/asm-generic/bitops/find.h: | /** | * find_first_zero_bit - find the

RE: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
On Wed, 4 Jun 2014, David Laight wrote: > From: Julia Lawall > > On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: > > > > > Hi Julia, > > > > > > On Wed, Jun 4, 2014 at 11:07 AM, Julia Lawall > > > wrote: > > > > Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may > > > > ret

RE: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread David Laight
From: Julia Lawall > On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: > > > Hi Julia, > > > > On Wed, Jun 4, 2014 at 11:07 AM, Julia Lawall wrote: > > > Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may > > > return a larger number than the maximum position argument if that po

Re: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Julia Lawall
On Wed, 4 Jun 2014, Geert Uytterhoeven wrote: > Hi Julia, > > On Wed, Jun 4, 2014 at 11:07 AM, Julia Lawall wrote: > > Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may > > return a larger number than the maximum position argument if that position > > is not a multiple of

Re: [PATCH 0/10] use safer test on the result of find_first_zero_bit

2014-06-04 Thread Geert Uytterhoeven
Hi Julia, On Wed, Jun 4, 2014 at 11:07 AM, Julia Lawall wrote: > Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may > return a larger number than the maximum position argument if that position > is not a multiple of BITS_PER_LONG. Shouldn't this be fixed in find_first_zero_