Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d17067e4 authored by gaurav jindal's avatar gaurav jindal Committed by Ingo Molnar
Browse files

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: default avatarGaurav <Jindal&lt;gauravjindal1104@gmail.com>
Signed-off-by: default avatarPeter 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: default avatarIngo Molnar <mingo@kernel.org>
parent 31e77c93
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);