diff mbox

security/selinux: Change bool variable name to index.

Message ID 1460644857-29218-1-git-send-email-prarit@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Prarit Bhargava April 14, 2016, 2:40 p.m. UTC
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 <paul@paul-moore.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Eric Paris <eparis@parisplace.org>
Cc: James Morris <james.l.morris@oracle.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Andrew Perepechko <anserper@ya.ru>
Cc: Jeff Vander Stoep <jeffv@google.com>
Cc: selinux@tycho.nsa.gov
Cc: Eric Paris <eparis@redhat.com>
Cc: Paul Moore <pmoore@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 security/selinux/include/conditional.h |    2 +-
 security/selinux/ss/services.c         |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Paul Moore April 14, 2016, 3:30 p.m. UTC | #1
On Thursday, April 14, 2016 10:40:57 AM Prarit Bhargava wrote:
> 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 <paul@paul-moore.com>
> Cc: Stephen Smalley <sds@tycho.nsa.gov>
> Cc: Eric Paris <eparis@parisplace.org>
> Cc: James Morris <james.l.morris@oracle.com>
> Cc: "Serge E. Hallyn" <serge@hallyn.com>
> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> Cc: Andrew Perepechko <anserper@ya.ru>
> Cc: Jeff Vander Stoep <jeffv@google.com>
> Cc: selinux@tycho.nsa.gov
> Cc: Eric Paris <eparis@redhat.com>
> Cc: Paul Moore <pmoore@redhat.com>
> Cc: David Howells <dhowells@redhat.com>
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> ---
>  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.

> diff --git a/security/selinux/include/conditional.h
> b/security/selinux/include/conditional.h index 67ce7a8..ff4fddc 100644
> --- a/security/selinux/include/conditional.h
> +++ b/security/selinux/include/conditional.h
> @@ -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
> diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
> index ebda973..89df646 100644
> --- a/security/selinux/ss/services.c
> +++ b/security/selinux/ss/services.c
> @@ -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;
diff mbox

Patch

diff --git a/security/selinux/include/conditional.h b/security/selinux/include/conditional.h
index 67ce7a8..ff4fddc 100644
--- a/security/selinux/include/conditional.h
+++ b/security/selinux/include/conditional.h
@@ -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
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index ebda973..89df646 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -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;