diff mbox series

sched: completion: use bool in try_wait_for_completion

Message ID 20180214103002.GA15068@gmail.com
State Superseded
Headers show
Series sched: completion: use bool in try_wait_for_completion | expand

Commit Message

gaurav jindal Feb. 14, 2018, 10:30 a.m. UTC
Use bool in place of int in the function try_wait_for_completion.

Signed-off-by: Gaurav Jindal<gauravjindal1104@gmail.com>


---

Comments

Peter Zijlstra Feb. 19, 2018, 10:44 a.m. UTC | #1
On Wed, Feb 14, 2018 at 04:00:02PM +0530, gaurav jindal wrote:
> Use bool in place of int in the function try_wait_for_completion.


I can see that from the patch; what you failed to describe is why you've
bothered to do the patch.

Which doesn't apply because of whitespace damage; please re-read the
documentation on how to send patches.
diff mbox series

Patch

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);