From e0c56fd71fbd7e8ef307777db8940fb2cf3c9957 Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Fri, 9 Dec 2022 14:04:22 +0100 Subject: [PATCH] fix(fdt-wrappers): use correct prototypes These issues were triggered by sparse tool: common/fdt_wrappers.c:209:36: warning: incorrect type in assignment (different base types) expected unsigned long long [usertype] got restricted fdt64_t common/fdt_wrappers.c:211:36: warning: incorrect type in assignment (different base types) expected unsigned int [usertype] got restricted fdt32_t common/fdt_wrappers.c:401:45: warning: incorrect type in argument 1 (different base types) expected restricted fdt32_t const [usertype] *prop got unsigned int const [usertype] *value common/fdt_wrappers.c:402:52: warning: incorrect type in argument 1 (different base types) expected restricted fdt32_t const [usertype] *prop got unsigned int const [usertype] * common/fdt_wrappers.c:404:66: warning: incorrect type in argument 1 (different base types) expected restricted fdt32_t const [usertype] *prop got unsigned int const [usertype] * Signed-off-by: Yann Gautier Change-Id: I32067607cd4da1897f0ce5d8e1e2d51e044ab815 --- common/fdt_wrappers.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/fdt_wrappers.c b/common/fdt_wrappers.c index 1b065b1e2..783b660ee 100644 --- a/common/fdt_wrappers.c +++ b/common/fdt_wrappers.c @@ -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 */ @@ -206,9 +206,9 @@ int fdtw_write_inplace_cells(void *dtb, int node, const char *prop, assert(cells <= 2U); if (cells == 2U) - *(uint64_t *)value = cpu_to_fdt64(*(uint64_t *)value); + *(fdt64_t *)value = cpu_to_fdt64(*(uint64_t *)value); else - *(uint32_t *)value = cpu_to_fdt32(*(uint32_t *)value); + *(fdt32_t *)value = cpu_to_fdt32(*(uint32_t *)value); len = (int)cells * 4; @@ -392,7 +392,7 @@ int fdt_get_stdout_node_offset(const void *dtb) * to a global address with help of various helper functions. ******************************************************************************/ -static bool fdtw_xlat_hit(const uint32_t *value, int child_addr_size, +static bool fdtw_xlat_hit(const fdt32_t *value, int child_addr_size, int parent_addr_size, int range_size, uint64_t base_address, uint64_t *translated_addr) { @@ -427,7 +427,7 @@ static uint64_t fdtw_search_all_xlat_entries(const void *dtb, int local_bus, uint64_t base_address) { uint64_t translated_addr; - const uint32_t *next_entry; + const fdt32_t *next_entry; int parent_bus_node, nxlat_entries, length; int self_addr_cells, parent_addr_cells, self_size_cells, ncells_xlat; @@ -460,7 +460,7 @@ static uint64_t fdtw_search_all_xlat_entries(const void *dtb, assert(nxlat_entries > 0); - next_entry = (const uint32_t *)ranges_prop->data; + next_entry = (const fdt32_t *)ranges_prop->data; /* Iterate over the entries in the "ranges" */ for (int i = 0; i < nxlat_entries; i++) {