fix(xlat): fix defects on the xlat library reported by coverity scan

The coverity defects fixed by this patch is

** CID 394601:  Integer handling issues  (NO_EFFECT)
/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c: 30 in
xlat_arch_is_granule_size_supported()

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: Ibc8e20bd7318a52702fbd7aa86e22cd2ded42610
This commit is contained in:
Javier Almansa Sobrino 2023-07-12 17:42:36 +01:00
parent e318411f02
commit 2974ad87b8

View file

@ -27,16 +27,14 @@ bool xlat_arch_is_granule_size_supported(size_t size)
if (size == PAGE_SIZE_4KB) {
tgranx = read_id_aa64mmfr0_el0_tgran4_field();
/* MSB of TGRAN4 field will be '1' for unsupported feature */
return ((tgranx >= ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED) &&
(tgranx < 8U));
return (tgranx < 8U);
} else if (size == PAGE_SIZE_16KB) {
tgranx = read_id_aa64mmfr0_el0_tgran16_field();
return (tgranx >= ID_AA64MMFR0_EL1_TGRAN16_SUPPORTED);
} else if (size == PAGE_SIZE_64KB) {
tgranx = read_id_aa64mmfr0_el0_tgran64_field();
/* MSB of TGRAN64 field will be '1' for unsupported feature */
return ((tgranx >= ID_AA64MMFR0_EL1_TGRAN64_SUPPORTED) &&
(tgranx < 8U));
return (tgranx < 8U);
} else {
return false;
}