Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-16 Thread Jesper Juhl
On Fri, 15 Apr 2005, Ingo Molnar wrote: > > * Jesper Juhl <[EMAIL PROTECTED]> wrote: > > > As per this patch perhaps? : > > > > Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> > > this is still not enough (there was one more comparison to cover). Also, > it's a bit cleaner to just cast the le

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-15 Thread Ingo Molnar
* Jesper Juhl <[EMAIL PROTECTED]> wrote: > As per this patch perhaps? : > > Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> this is still not enough (there was one more comparison to cover). Also, it's a bit cleaner to just cast the left side to signed than cast every member separately.

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Nick Piggin
On Fri, 2005-04-15 at 12:59 +1000, Herbert Xu wrote: > Jesper Juhl <[EMAIL PROTECTED]> wrote: > > > > - if (unlikely((long long)now - prev->timestamp < 0)) > > + if (unlikely(((long long)now - (long long)prev->timestamp) > > < 0)) > > You can write this as > > (long l

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Herbert Xu
Jesper Juhl <[EMAIL PROTECTED]> wrote: > > - if (unlikely((long long)now - prev->timestamp < 0)) > + if (unlikely(((long long)now - (long long)prev->timestamp) < > 0)) You can write this as (long long)(now - prev->timestamp) Cheers, -- Visit Openswan at http://www.o

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Matt Mackall
On Fri, Apr 15, 2005 at 10:23:11AM +1000, Nick Piggin wrote: > Jesper Juhl wrote: > > > > >As per this patch perhaps? : > > > > Thanks. I'll make sure it gets to the right place if nobody picks it up. Perhaps this ought to be wrapped up in sched_clock_before() or some such. -- Mathematics is

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Nick Piggin
Jesper Juhl wrote: As per this patch perhaps? : Thanks. I'll make sure it gets to the right place if nobody picks it up. Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> --- linux-2.6.12-rc2-mm3-orig/kernel/sched.c 2005-04-11 21:20:56.0 +0200 +++ linux-2.6.12-rc2-mm3/kernel/sched.c 2005-04-

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Jesper Juhl
On Fri, 15 Apr 2005, Nick Piggin wrote: > Jesper Juhl wrote: > > On Fri, 15 Apr 2005, Nick Piggin wrote: > > > > > > > Jesper Juhl wrote: > > > > > > > There are two expressions in kernel/sched.c that are always false since > > > > they > > > > test for <0 but the result of the expression is un

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Nick Piggin
Jesper Juhl wrote: On Fri, 15 Apr 2005, Nick Piggin wrote: Jesper Juhl wrote: There are two expressions in kernel/sched.c that are always false since they test for <0 but the result of the expression is unsigned so they will never be less than zero. This patch implement the logic that I believe is

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Jesper Juhl
On Fri, 15 Apr 2005, Nick Piggin wrote: > Jesper Juhl wrote: > > There are two expressions in kernel/sched.c that are always false since they > > test for <0 but the result of the expression is unsigned so they will never > > be less than zero. This patch implement the logic that I believe is inte

Re: [PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Nick Piggin
Jesper Juhl wrote: There are two expressions in kernel/sched.c that are always false since they test for <0 but the result of the expression is unsigned so they will never be less than zero. This patch implement the logic that I believe is intended without the signedness issue and without the na

[PATCH] sched: fix never executed code due to expression always false

2005-04-14 Thread Jesper Juhl
There are two expressions in kernel/sched.c that are always false since they test for <0 but the result of the expression is unsigned so they will never be less than zero. This patch implement the logic that I believe is intended without the signedness issue and without the nasty casts. patch i