mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 10:04:26 +00:00
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:
parent
e318411f02
commit
2974ad87b8
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue