Home
last modified time | relevance | path

Searched hist:"6 bf41237" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/include/linux/
H A Dcompletion.h6bf41237 Tue Jan 04 19:50:16 CST 2011 NeilBrown <neilb@suse.de> sched: Change wait_for_completion_*_timeout() to return a signed long

wait_for_completion_*_timeout() can return:

0: if the wait timed out
-ve: if the wait was interrupted
+ve: if the completion was completed.

As they currently return an 'unsigned long', the last two cases
are not easily distinguished which can easily result in buggy
code, as is the case for the recently added
wait_for_completion_interruptible_timeout() call in
net/sunrpc/cache.c

So change them both to return 'long'. As MAX_SCHEDULE_TIMEOUT
is LONG_MAX, a large +ve return value should never overflow.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: J. Bruce Fields <bfields@fieldses.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20110105125016.64ccab0e@notabene.brown>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
6bf41237 Tue Jan 04 19:50:16 CST 2011 NeilBrown <neilb@suse.de> sched: Change wait_for_completion_*_timeout() to return a signed long

wait_for_completion_*_timeout() can return:

0: if the wait timed out
-ve: if the wait was interrupted
+ve: if the completion was completed.

As they currently return an 'unsigned long', the last two cases
are not easily distinguished which can easily result in buggy
code, as is the case for the recently added
wait_for_completion_interruptible_timeout() call in
net/sunrpc/cache.c

So change them both to return 'long'. As MAX_SCHEDULE_TIMEOUT
is LONG_MAX, a large +ve return value should never overflow.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: J. Bruce Fields <bfields@fieldses.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20110105125016.64ccab0e@notabene.brown>
Signed-off-by: Ingo Molnar <mingo@elte.hu>