sched/completions: Use bool in try_wait_for_completion()
Since the return type of the function is bool, the internal 'ret' variable should be bool too. Signed-off-by: Gaurav Jindal<gauravjindal1104@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20180221125407.GA14292@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
31e77c93e4
commit
d17067e448
|
@ -280,7 +280,7 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout);
|
|||
bool try_wait_for_completion(struct completion *x)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret = 1;
|
||||
bool ret = true;
|
||||
|
||||
/*
|
||||
* Since x->done will need to be locked only
|
||||
|
@ -289,11 +289,11 @@ bool try_wait_for_completion(struct completion *x)
|
|||
* return early in the blocking case.
|
||||
*/
|
||||
if (!READ_ONCE(x->done))
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
spin_lock_irqsave(&x->wait.lock, flags);
|
||||
if (!x->done)
|
||||
ret = 0;
|
||||
ret = false;
|
||||
else if (x->done != UINT_MAX)
|
||||
x->done--;
|
||||
spin_unlock_irqrestore(&x->wait.lock, flags);
|
||||
|
|
Loading…
Reference in New Issue