From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932263AbbC3XuS (ORCPT ); Mon, 30 Mar 2015 19:50:18 -0400 Received: from smtprelay0154.hostedemail.com ([216.40.44.154]:48795 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754167AbbC3Xr5 (ORCPT ); Mon, 30 Mar 2015 19:47:57 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1345:1359:1381:1437:1534:1542:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2693:2895:3138:3139:3140:3141:3142:3353:3865:3866:3867:3870:3871:4321:4385:5007:6119:6261:7903:10004:10848:11026:11658:11914:12043:12296:12438:12517:12519:12555:14096:14394:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: uncle04_282f6305eb838 X-Filterd-Recvd-Size: 2843 From: Joe Perches To: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra Subject: [PATCH 19/25] sched: Use bool function return values of true/false not 1/0 Date: Mon, 30 Mar 2015 16:46:17 -0700 Message-Id: <93bd3fb8db14c75508f7169840824539a3f89606.1427759010.git.joe@perches.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the normal return values for bool functions Update the other sets of ret in try_wait_for_completion. Signed-off-by: Joe Perches --- kernel/sched/auto_group.h | 2 +- kernel/sched/completion.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/kernel/sched/auto_group.h b/kernel/sched/auto_group.h index 8bd0471..309b6f2 100644 --- a/kernel/sched/auto_group.h +++ b/kernel/sched/auto_group.h @@ -45,7 +45,7 @@ static inline void autogroup_init(struct task_struct *init_task) { } static inline void autogroup_free(struct task_group *tg) { } static inline bool task_group_is_autogroup(struct task_group *tg) { - return 0; + return false; } static inline struct task_group * diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index 8d0f35d..cbccaa0 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -255,8 +255,8 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout); * try_wait_for_completion - try to decrement a completion without blocking * @x: completion structure * - * Return: 0 if a decrement cannot be done without blocking - * 1 if a decrement succeeded. + * Return: true if a decrement cannot be done without blocking + * false if a decrement succeeded. * * If a completion is being used as a counting completion, * attempt to decrement the counter without blocking. This @@ -266,7 +266,7 @@ EXPORT_SYMBOL(wait_for_completion_killable_timeout); bool try_wait_for_completion(struct completion *x) { unsigned long flags; - int ret = 1; + bool ret; /* * Since x->done will need to be locked only @@ -275,13 +275,15 @@ 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; - else + if (!x->done) { + ret = false; + } else { x->done--; + ret = true; + } spin_unlock_irqrestore(&x->wait.lock, flags); return ret; } -- 2.1.2