Skip to content

Commit d17067e

Browse files
grvjindal100Ingo Molnar
authored andcommitted
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>
1 parent 31e77c9 commit d17067e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/sched/completion.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout);
280280
bool try_wait_for_completion(struct completion *x)
281281
{
282282
unsigned long flags;
283-
int ret = 1;
283+
bool ret = true;
284284

285285
/*
286286
* Since x->done will need to be locked only
@@ -289,11 +289,11 @@ bool try_wait_for_completion(struct completion *x)
289289
* return early in the blocking case.
290290
*/
291291
if (!READ_ONCE(x->done))
292-
return 0;
292+
return false;
293293

294294
spin_lock_irqsave(&x->wait.lock, flags);
295295
if (!x->done)
296-
ret = 0;
296+
ret = false;
297297
else if (x->done != UINT_MAX)
298298
x->done--;
299299
spin_unlock_irqrestore(&x->wait.lock, flags);

0 commit comments

Comments
 (0)