aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2024-11-25 12:06:44 +0100
committerPaul Moore <paul@paul-moore.com>2024-12-11 13:54:14 -0500
commitc75c7945cd49c05404b00358108084a175a5fb29 (patch)
treef499ebdaaa4ef1aa4097ce509a7c70b04bff4c4f /security/selinux/hooks.c
parentselinux: add generated av_permissions.h to targets (diff)
downloadwireguard-linux-c75c7945cd49c05404b00358108084a175a5fb29.tar.xz
wireguard-linux-c75c7945cd49c05404b00358108084a175a5fb29.zip
selinux: use native iterator types
Use types for iterators equal to the type of the to be compared values. Reported by clang: ../ss/sidtab.c:126:2: warning: comparison of integers of different signs: 'int' and 'unsigned long' 126 | hash_for_each_rcu(sidtab->context_to_sid, i, entry, list) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../hashtable.h:139:51: note: expanded from macro 'hash_for_each_rcu' 139 | for (... ; obj == NULL && (bkt) < HASH_SIZE(name);\ | ~~~ ^ ~~~~~~~~~~~~~~~ ../selinuxfs.c:1520:23: warning: comparison of integers of different signs: 'int' and 'unsigned int' 1520 | for (cpu = *idx; cpu < nr_cpu_ids; ++cpu) { | ~~~ ^ ~~~~~~~~~~ ../hooks.c:412:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' 412 | for (i = 0; i < ARRAY_SIZE(tokens); i++) { | ~ ^ ~~~~~~~~~~~~~~~~~~ Signed-off-by: Christian Göttsche <cgzones@googlemail.com> [PM: munged the clang output due to line length concerns] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f5a08f94e094..2afc45f355a4 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -407,7 +407,7 @@ static const struct {
static int match_opt_prefix(char *s, int l, char **arg)
{
- int i;
+ unsigned int i;
for (i = 0; i < ARRAY_SIZE(tokens); i++) {
size_t len = tokens[i].len;