summaryrefslogtreecommitdiff
path: root/kernel/sched/completion.c
diff options
context:
space:
mode:
authorgaurav jindal <gauravjindal1104@gmail.com>2018-02-21 15:54:07 +0300
committerIngo Molnar <mingo@kernel.org>2018-03-09 10:00:18 +0300
commitd17067e4487adc53bedb43681b3cb5a1714ff6ca (patch)
tree753ae95f8eadd0285f90929c3fd84d377bf0d59b /kernel/sched/completion.c
parent31e77c93e432dec79c7d90b888bbfc3652592741 (diff)
downloadlinux-d17067e4487adc53bedb43681b3cb5a1714ff6ca.tar.xz
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>
Diffstat (limited to 'kernel/sched/completion.c')
-rw-r--r--kernel/sched/completion.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c
index 5d2d56b0817a..e426b0cb9ac6 100644
--- a/kernel/sched/completion.c
+++ b/kernel/sched/completion.c
@@ -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);