From: tip-bot for gaurav jindal <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com,
peterz@infradead.org, gauravjindal1104@gmail.com,
mingo@kernel.org, torvalds@linux-foundation.org
Subject: [tip:sched/core] sched/completions: Use bool in try_wait_for_completion()
Date: Fri, 9 Mar 2018 01:06:54 -0800 [thread overview]
Message-ID: <tip-d17067e4487adc53bedb43681b3cb5a1714ff6ca@git.kernel.org> (raw)
In-Reply-To: <20180221125407.GA14292@gmail.com>
Commit-ID: d17067e4487adc53bedb43681b3cb5a1714ff6ca
Gitweb: https://git.kernel.org/tip/d17067e4487adc53bedb43681b3cb5a1714ff6ca
Author: gaurav jindal <gauravjindal1104@gmail.com>
AuthorDate: Wed, 21 Feb 2018 18:24:07 +0530
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 9 Mar 2018 08:00:18 +0100
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>
---
kernel/sched/completion.c | 6 +++---
1 file 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);
prev parent reply other threads:[~2018-03-09 9:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 12:54 [PATCH]sched: completion: use bool in try_wait_for_completion gaurav jindal
2018-02-21 13:28 ` Peter Zijlstra
2018-02-21 13:49 ` gaurav jindal
2018-03-09 9:06 ` tip-bot for gaurav jindal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-d17067e4487adc53bedb43681b3cb5a1714ff6ca@git.kernel.org \
--to=tipbot@zytor.com \
--cc=gauravjindal1104@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.