Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>
Acked-by: David Howells <dhowells@redhat.com>
[PM: wrapped description for checkpatch.pl, use "selinux:..." as subj]
Signed-off-by: Paul Moore <paul@paul-moore.com>

authored by

Prarit Bhargava and committed by
Paul Moore
0fd71a62 61d612ea

+4 -4
+1 -1
security/selinux/include/conditional.h
··· 17 17 18 18 int security_set_bools(int len, int *values); 19 19 20 - int security_get_bool_value(int bool); 20 + int security_get_bool_value(int index); 21 21 22 22 #endif
+3 -3
security/selinux/ss/services.c
··· 2696 2696 return rc; 2697 2697 } 2698 2698 2699 - int security_get_bool_value(int bool) 2699 + int security_get_bool_value(int index) 2700 2700 { 2701 2701 int rc; 2702 2702 int len; ··· 2705 2705 2706 2706 rc = -EFAULT; 2707 2707 len = policydb.p_bools.nprim; 2708 - if (bool >= len) 2708 + if (index >= len) 2709 2709 goto out; 2710 2710 2711 - rc = policydb.bool_val_to_struct[bool]->state; 2711 + rc = policydb.bool_val_to_struct[index]->state; 2712 2712 out: 2713 2713 read_unlock(&policy_rwlock); 2714 2714 return rc;