selinux: use int arrays for boolean values
authorChristian Göttsche <cgzones@googlemail.com>
Tue, 30 Aug 2022 15:45:00 +0000 (17:45 +0200)
committerPaul Moore <paul@paul-moore.com>
Tue, 30 Aug 2022 21:03:33 +0000 (17:03 -0400)
commitc3fae2b2e690ab92ee1306cc22126240ab70e371
tree1b7b1a24f7f57209dd7b42a9ca0715d5ed7ee087
parent5698f08169b905ed215fa7f45e89b42283ed0554
selinux: use int arrays for boolean values

Do not cast pointers of signed integers to pointers of unsigned integers
and vice versa.

It should currently not be an issue since they hold SELinux boolean
values which should only contain either 0's or 1's, which should have
the same representation.

Reported by sparse:

  .../selinuxfs.c:1485:30: warning: incorrect type in assignment
                                    (different signedness)
  .../selinuxfs.c:1485:30:    expected unsigned int *
  .../selinuxfs.c:1485:30:    got int *[addressable] values
  .../selinuxfs.c:1402:48: warning: incorrect type in argument 3
                                    (different signedness)
  .../selinuxfs.c:1402:48:    expected int *values
  .../selinuxfs.c:1402:48:    got unsigned int *bool_pending_values

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
[PM: minor whitespace fixes, sparse output cleanup]
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/selinuxfs.c