mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
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>
This commit is contained in:
parent
14bac449fa
commit
6e4da01ffb
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ int spmd_pm_secondary_core_set_ep(unsigned long long mpidr,
|
||||||
{
|
{
|
||||||
int id = plat_core_pos_by_mpidr(mpidr);
|
int id = plat_core_pos_by_mpidr(mpidr);
|
||||||
|
|
||||||
if ((id < 0) || (id >= PLATFORM_CORE_COUNT)) {
|
if ((id < 0) || ((unsigned int)id >= PLATFORM_CORE_COUNT)) {
|
||||||
ERROR("%s inconsistent MPIDR (%llx)\n", __func__, mpidr);
|
ERROR("%s inconsistent MPIDR (%llx)\n", __func__, mpidr);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue