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/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;