]> git.baikalelectronics.ru Git - arm-tf.git/commit
spmd: Fix signedness comparison warning
authorAndre Przywara <andre.przywara@arm.com>
Fri, 2 Oct 2020 10:54:56 +0000 (11:54 +0100)
committerAlexei Fedorov <Alexei.Fedorov@arm.com>
Fri, 2 Oct 2020 12:14:02 +0000 (12:14 +0000)
commit6e4da01ffbf42bf97933d72868f38aa378313698
tree2b837127665fd1478b761b9e52154d44d9988e1d
parent14bac449fa29c9576abdda36b4e8f77deb99d9bb
spmd: Fix signedness comparison warning

With -Wsign-compare, compilers issue a warning in the SPMD code:
====================
services/std_svc/spmd/spmd_pm.c:35:22: error: comparison of integer
expressions of different signedness: 'int' and 'unsigned int'
[-Werror=sign-compare]
   35 |  if ((id < 0) || (id >= PLATFORM_CORE_COUNT)) {
      |                      ^~
cc1: all warnings being treated as errors
====================

Since we just established that "id" is positive, we can safely cast it
to an unsigned type to make the comparison have matching types.

Change-Id: I6ef24804c88136d7e3f15de008e4fea854f10ffe
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
services/std_svc/spmd/spmd_pm.c