fix(clang): fix bugprone-narrowing-conversions errors
Remove silent narrowing conversions.
Note in fdt_patch_mem since the conversion of fdt_max_size occurs
on the boundary between hafnium and third_party libaries we use a
cast to make the conversion explicit however the conversion itself
is not removed.
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: I4ece5be0262ae06e3dc63e5970ec1a014956a43f
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 147c711..fff1ea2 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -969,7 +969,7 @@
#if SECURE_WORLD == 1
struct vcpu_locked current_locked;
struct vcpu *current_vcpu = current();
- int ret;
+ int64_t ret;
if (plat_ffa_vm_managed_exit_supported(current_vcpu->vm)) {
/* Mask all interrupts */
diff --git a/src/fdt_patch.c b/src/fdt_patch.c
index 0a4a045..4e7f535 100644
--- a/src/fdt_patch.c
+++ b/src/fdt_patch.c
@@ -52,7 +52,7 @@
struct boot_params_update *p, struct mpool *ppool)
{
void *fdt;
- size_t buf_size;
+ int buf_size;
int off;
bool ret = false;
bool rsv;
@@ -185,7 +185,7 @@
}
/* Allow some extra room for patches to the FDT. */
- ret = fdt_open_into(fdt, fdt, fdt_max_size);
+ ret = fdt_open_into(fdt, fdt, (int)fdt_max_size);
if (ret != 0) {
dlog_error("FDT failed to open_into. Error: %d\n", ret);
goto out_unmap_fdt;
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
index 4f1b308..120d958 100644
--- a/src/ffa_memory.c
+++ b/src/ffa_memory.c
@@ -731,7 +731,7 @@
struct vm_locked vm_locked,
struct ffa_memory_region_constituent **fragments,
const uint32_t *fragment_constituent_counts, uint32_t fragment_count,
- int mode, struct mpool *ppool, bool commit)
+ uint32_t mode, struct mpool *ppool, bool commit)
{
uint32_t i;
uint32_t j;