From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752213AbbCaGDl (ORCPT ); Tue, 31 Mar 2015 02:03:41 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:33962 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750769AbbCaGDj (ORCPT ); Tue, 31 Mar 2015 02:03:39 -0400 Message-ID: <551A38B4.70000@canonical.com> Date: Mon, 30 Mar 2015 23:03:32 -0700 From: John Johansen Organization: Canonical User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Joe Perches , linux-kernel@vger.kernel.org CC: James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org Subject: Re: [PATCH 24/25] security: Use bool function return values of true/false not 1/0 References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/30/2015 04:46 PM, Joe Perches wrote: > Use the normal return values for bool functions > > Signed-off-by: Joe Perches Joe, I'll pull this into my tree and send it up with a couple of other patches I have pending Acked-by: John Johansen > --- > 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, >