Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-10 Thread Paul Mackerras
Manish Ahuja writes: > I presume the patch is good then. Do I need to change anything ? I guess not. It will cause a warning on the first for loop if anyone tries to compile with -Wextra or -Wsign-compare, but it would be only one of lots of warnings in that case (and in fact comparing signed wi

Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-10 Thread Manish Ahuja
Paul Mackerras wrote: > Andreas Schwab writes: > > ??? There is no rgn->cnt involved in the comparison. >>> Look further down in lmb_add_region; there is a second for loop that >>> does >>> >>> for (i = rgn->cnt-1; i >= 0; i--) >>> >> Which is exactly the one quoted

Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-10 Thread Paul Mackerras
Andreas Schwab writes: > >> ??? There is no rgn->cnt involved in the comparison. > > > > Look further down in lmb_add_region; there is a second for loop that > > does > > > > for (i = rgn->cnt-1; i >= 0; i--) > > Which is exactly the one quoted above. I still don't see your point. You're ri

Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-10 Thread Andreas Schwab
Paul Mackerras <[EMAIL PROTECTED]> writes: > Andreas Schwab writes: >> Paul Mackerras <[EMAIL PROTECTED]> writes: >> >> > Manish Ahuja writes: >> > >> >> Repost to fix my email id. >> >> >> >> Fix to correct a possible infinite loop or an always true check when the >> >> unsigned long counter "

Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-10 Thread Paul Mackerras
Andreas Schwab writes: > Paul Mackerras <[EMAIL PROTECTED]> writes: > > > Manish Ahuja writes: > > > >> Repost to fix my email id. > >> > >> Fix to correct a possible infinite loop or an always true check when the > >> unsigned long counter "i" is used in > >> lmb_add_region() in the following f

Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-10 Thread Andreas Schwab
Paul Mackerras <[EMAIL PROTECTED]> writes: > Manish Ahuja writes: > >> Repost to fix my email id. >> >> Fix to correct a possible infinite loop or an always true check when the >> unsigned long counter "i" is used in >> lmb_add_region() in the following for loop: >> >> for (i = rgn->cnt-1; i >=

Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-09 Thread Felix Domke
Paul Mackerras wrote: >> Fix to correct a possible infinite loop or an always true check when the >> unsigned long counter "i" is used in >> lmb_add_region() in the following for loop: >> for (i = rgn->cnt-1; i >= 0; i--) > Unfortunately this won't fix the bug. Since rgn->cnt is unsigned > long,

Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-09 Thread Paul Mackerras
Manish Ahuja writes: > Repost to fix my email id. > > Fix to correct a possible infinite loop or an always true check when the > unsigned long counter "i" is used in > lmb_add_region() in the following for loop: > > for (i = rgn->cnt-1; i >= 0; i--) Unfortunately this won't fix the bug. Since

Re: [PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-09 Thread Manish Ahuja
Repost to fix my email id. Fix to correct a possible infinite loop or an always true check when the unsigned long counter "i" is used in lmb_add_region() in the following for loop: for (i = rgn->cnt-1; i >= 0; i--) Signed-off-by: Manish Ahuja <[EMAIL PROTECTED]> --- arch/powerpc/mm/lmb.c |

[PATCH] Infinite loop/always true check possible with unsigned counter.

2007-07-09 Thread Manish Ahuja
Fix to correct a possible infinite loop or an always true check when the unsigned long counter "i" is used in lmb_add_region() in the following for loop: for (i = rgn->cnt-1; i >= 0; i--) Signed-off-by: Manish Ahuja <[EMAIL PROTECTED]> --- arch/powerpc/mm/lmb.c |4 ++-- 1 file changed, 2