refactor(fdt-wrappers): fix for unit testing errors

As the unit testing project uses the host machine GCC version to
compile, it is marking non-casted references as errors. This patch adds
the proper casting, so it compiles correctly for both Arm platforms and
host machines for unit testing.

Change-Id: Iee96e9117301ba28b6f164aac2cd36dc0f8b6be8
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
This commit is contained in:
Juan Pablo Conde 2023-06-22 16:33:15 -05:00
parent 14196178f1
commit e7c0f42a2e

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -49,7 +49,7 @@ int fdtw_find_or_add_subnode(void *fdt, int parentoffset, const char *name);
static inline uint32_t fdt_blob_size(const void *dtb)
{
const uint32_t *dtb_header = dtb;
const uint32_t *dtb_header = (const uint32_t *)dtb;
return fdt32_to_cpu(dtb_header[1]);
}
@ -60,7 +60,8 @@ static inline bool fdt_node_is_enabled(const void *fdt, int node)
const void *prop = fdt_getprop(fdt, node, "status", &len);
/* A non-existing status property means the device is enabled. */
return (prop == NULL) || (len == 5 && strcmp(prop, "okay") == 0);
return (prop == NULL) || (len == 5 && strcmp((const char *)prop,
"okay") == 0);
}
#define fdt_for_each_compatible_node(dtb, node, compatible_str) \