lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <ac3ecf830eb3a0cec2bff1d8e20278a110f4b92c.1427759010.git.joe@perches.com>
Date:	Mon, 30 Mar 2015 16:46:22 -0700
From:	Joe Perches <joe@...ches.com>
To:	linux-kernel@...r.kernel.org,
	John Johansen <john.johansen@...onical.com>
Cc:	James Morris <james.l.morris@...cle.com>,
	"Serge E. Hallyn" <serge@...lyn.com>,
	linux-security-module@...r.kernel.org
Subject: [PATCH 24/25] security: Use bool function return values of true/false not 1/0

Use the normal return values for bool functions

Signed-off-by: Joe Perches <joe@...ches.com>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ