From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932162AbbC3XsV (ORCPT ); Mon, 30 Mar 2015 19:48:21 -0400 Received: from smtprelay0048.hostedemail.com ([216.40.44.48]:37872 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932125AbbC3XsO (ORCPT ); Mon, 30 Mar 2015 19:48:14 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1359:1437:1534:1542:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2894:2902:2910:3138:3139:3140:3141:3142:3353:3865:3866:3871:4321:5007:6261:7774:9010:10004:10848:11026:11473: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: boys84_2a9eaf05b765b X-Filterd-Recvd-Size: 2880 From: Joe Perches To: linux-kernel@vger.kernel.org, John Johansen Cc: James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org Subject: [PATCH 24/25] security: Use bool function return values of true/false not 1/0 Date: Mon, 30 Mar 2015 16:46:22 -0700 Message-Id: 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 Signed-off-by: Joe Perches --- security/apparmor/file.c | 8 ++++---- security/apparmor/policy.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/security/apparmor/file.c b/security/apparmor/file.c index fdaa50c..bd804d4 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c @@ -260,8 +260,8 @@ unsigned int aa_str_perms(struct aa_dfa *dfa, unsigned int start, static inline bool is_deleted(struct dentry *dentry) { if (d_unlinked(dentry) && dentry->d_inode->i_nlink == 0) - return 1; - return 0; + return true; + return false; } /** @@ -322,9 +322,9 @@ static inline bool xindex_is_subset(u32 link, u32 target) { if (((link & ~AA_X_UNSAFE) != (target & ~AA_X_UNSAFE)) || ((link & AA_X_UNSAFE) && !(target & AA_X_UNSAFE))) - return 0; + return false; - return 1; + return true; } /** diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 705c287..a8e0177 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -137,13 +137,13 @@ static bool policy_init(struct aa_policy *policy, const char *prefix, } else policy->hname = kstrdup(name, GFP_KERNEL); if (!policy->hname) - return 0; + return false; /* base.name is a substring of fqname */ policy->name = (char *)hname_tail(policy->hname); INIT_LIST_HEAD(&policy->list); INIT_LIST_HEAD(&policy->profiles); - return 1; + return true; } /** @@ -927,15 +927,15 @@ bool aa_may_manage_policy(int op) /* check if loading policy is locked out */ if (aa_g_lock_policy) { audit_policy(op, GFP_KERNEL, NULL, "policy_locked", -EACCES); - return 0; + return false; } if (!capable(CAP_MAC_ADMIN)) { audit_policy(op, GFP_KERNEL, NULL, "not policy admin", -EACCES); - return 0; + return false; } - return 1; + return true; } static struct aa_profile *__list_lookup_parent(struct list_head *lh, -- 2.1.2