Home
last modified time | relevance | path

Searched hist:"4276 cfe2fa6fba6dc71a2cc3c0c2a5cc194ce542" (Results 1 – 1 of 1) sorted by relevance

/rk3399_ARM-atf/common/
H A Dfdt_fixup.c4276cfe2fa6fba6dc71a2cc3c0c2a5cc194ce542 Wed Oct 07 10:09:42 UTC 2020 Andre Przywara <andre.przywara@arm.com> fdt: Fix coverity complaint about 32-bit multiplication

Coverity raised an eyebrow over our GICR frame size calculation:
========
CID 362942: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
Potentially overflowing expression "nr_cores * gicr_frame_size" with type
"unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic,
and then used in a context that expects an expression of type "uint64_t"
(64 bits, unsigned).
========

Even with a GICv4 (256KB frame size) we need 16384 cores to overflow
32-bit, so it's not a practical issue.

But it's also easy to fix, so let's just do that: cast gicr_frame_size
to an unsigned 64-bit integer, so that the multiplication is done in the
64-bit realm.

Change-Id: Iad10e19b9e58d5fbf9d13205fbcef0aac5ae48af
Signed-off-by: Andre Przywara <andre.przywara@arm.com>