From: gaurav jindal <gauravjindal1104@gmail.com>
To: peterz@infradead.org, mingo@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH]sched: completion: use bool in try_wait_for_completion
Date: Wed, 24 Jan 2018 15:27:14 +0530 [thread overview]
Message-ID: <20180124095714.GB20693@gmail.com> (raw)
Use bool in place of int in the function try_wait_for_completion.
Signed-off-by: Gaurav Jindal<gauravjindal1104@gmail.com>
---
diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c
index 0926aef..3e15e8d 100644
--- a/kernel/sched/completion.c
+++ b/kernel/sched/completion.c
@@ -283,7 +283,7 @@ int __sched wait_for_completion_killable(struct completion *x)
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
@@ -292,11 +292,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);
next reply other threads:[~2018-01-24 9:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 9:57 gaurav jindal [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-02-14 10:30 [PATCH]sched: completion: use bool in try_wait_for_completion gaurav jindal
2018-02-19 10:44 ` Peter Zijlstra
2018-02-21 12:54 gaurav jindal
2018-02-21 13:28 ` Peter Zijlstra
2018-02-21 13:49 ` gaurav jindal
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=20180124095714.GB20693@gmail.com \
--to=gauravjindal1104@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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.