Skip to contentSkip to conversation

security/selinux: Change bool variable name to index.

PATCH In review Prarit Bhargava 3 participants 3 messages Apr 14, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 security/selinux: Change bool variable name to index.

security_get_bool_value(int bool) argument "bool" conflicts with in-kernel macros such as BUILD_BUG(). This patch changes this to index which isn't a type.

Cc Paul Moore <[email protected]>
Cc Stephen Smalley <[email protected]>
Cc Eric Paris <[email protected]>
Cc James Morris <[email protected]>
Cc "Serge E. Hallyn" <[email protected]>
Cc Rasmus Villemoes <[email protected]>
Cc Andrew Perepechko <[email protected]>
Cc Jeff Vander Stoep <[email protected]>
Cc Eric Paris <[email protected]>
Cc Paul Moore <[email protected]>
Cc David Howells <[email protected]>
---
 security/selinux/include/conditional.h |    2 +-
 security/selinux/ss/services.c         |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
security/selinux/include/conditional.h +1 -1
index 67ce7a8..ff4fddc 100644
@@ -17,6 +17,6 @@ int security_get_bools(int *len, char ***names, int **values);
 
 int security_set_bools(int len, int *values);
 
-int security_get_bool_value(int bool);
+int security_get_bool_value(int index);
 
 #endif
security/selinux/ss/services.c +3 -3
index ebda973..89df646 100644
@@ -2696,7 +2696,7 @@ out:
 	return rc;
 }
 
-int security_get_bool_value(int bool)
+int security_get_bool_value(int index)
 {
 	int rc;
 	int len;
@@ -2705,10 +2705,10 @@ int security_get_bool_value(int bool)
 
 	rc = -EFAULT;
 	len = policydb.p_bools.nprim;
-	if (bool >= len)
+	if (index >= len)
 		goto out;
 
-	rc = policydb.bool_val_to_struct[bool]->state;
+	rc = policydb.bool_val_to_struct[index]->state;
 out:
 	read_unlock(&policy_rwlock);
 	return rc;
Signature · 1 line
1.7.9.3
maintainer
#2 lore raw
In reply to Prarit Bhargava
Quoted 17 lines · Prarit Bhargava

security_get_bool_value(int bool) argument "bool" conflicts with in-kernel macros such as BUILD_BUG(). This patch changes this to index which isn't a type.

Cc Paul Moore <[email protected]>
Cc Stephen Smalley <[email protected]>
Cc Eric Paris <[email protected]>
Cc James Morris <[email protected]>
Cc "Serge E. Hallyn" <[email protected]>
Cc Rasmus Villemoes <[email protected]>
Cc Andrew Perepechko <[email protected]>
Cc Jeff Vander Stoep <[email protected]>
Cc Eric Paris <[email protected]>
Cc Paul Moore <[email protected]>
Cc David Howells <[email protected]>
Quoted 4 lines
---
 security/selinux/include/conditional.h |    2 +-
 security/selinux/ss/services.c         |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Looks good to me, merged into the SELinux next branch.

Quoted 39 lines
(quoted diff) +0 -0

b/security/selinux/include/conditional.h index 67ce7a8..ff4fddc 100644

security/selinux/include/conditional.h +1 -1
@@ -17,6 +17,6 @@ int security_get_bools(int *len, char ***names, int
 **values);
 
 int security_set_bools(int len, int *values);
 
-int security_get_bool_value(int bool);
+int security_get_bool_value(int index);
 

#endif

security/selinux/ss/services.c +3 -3
index ebda973..89df646 100644
@@ -2696,7 +2696,7 @@ out:
 	return rc;
 }
 
-int security_get_bool_value(int bool)
+int security_get_bool_value(int index)
 {
 	int rc;
 	int len;
@@ -2705,10 +2705,10 @@ int security_get_bool_value(int bool)
 
 	rc = -EFAULT;
 	len = policydb.p_bools.nprim;
-	if (bool >= len)
+	if (index >= len)
 		goto out;
 
-	rc = policydb.bool_val_to_struct[bool]->state;
+	rc = policydb.bool_val_to_struct[index]->state;
 out:
 	read_unlock(&policy_rwlock);
 	return rc;
Signature · 2 lines
paul moore
www.paul-moore.com