From: Antonio Nino Diaz Date: Tue, 30 Oct 2018 16:32:48 +0000 (+0000) Subject: plat/arm: Fix MISRA defects in dyn config X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b8a02d53c0b279359a2924fcd37f9d4dc3c46472;p=project%2Fbcm63xx%2Fatf.git plat/arm: Fix MISRA defects in dyn config Change-Id: Iae6758ca6395560131d1e1a69a1ecfe50ca8bf83 Signed-off-by: Antonio Nino Diaz --- diff --git a/include/plat/arm/common/arm_dyn_cfg_helpers.h b/include/plat/arm/common/arm_dyn_cfg_helpers.h index cb17c95f..3ad6d546 100644 --- a/include/plat/arm/common/arm_dyn_cfg_helpers.h +++ b/include/plat/arm/common/arm_dyn_cfg_helpers.h @@ -3,8 +3,8 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __ARM_DYN_CFG_HELPERS_H__ -#define __ARM_DYN_CFG_HELPERS_H__ +#ifndef ARM_DYN_CFG_HELPERS_H +#define ARM_DYN_CFG_HELPERS_H #include #include @@ -19,4 +19,4 @@ int arm_get_dtb_mbedtls_heap_info(void *dtb, void **heap_addr, int arm_set_dtb_mbedtls_heap_info(void *dtb, void *heap_addr, size_t heap_size); -#endif /* __ARM_DYN_CFG_HELPERS_H__ */ +#endif /* ARM_DYN_CFG_HELPERS_H */ diff --git a/plat/arm/common/arm_dyn_cfg.c b/plat/arm/common/arm_dyn_cfg.c index 057d772f..c2a4bb1e 100644 --- a/plat/arm/common/arm_dyn_cfg.c +++ b/plat/arm/common/arm_dyn_cfg.c @@ -122,8 +122,8 @@ void arm_bl1_set_mbedtls_heap(void) void arm_load_tb_fw_config(void) { int err; - uintptr_t config_base = 0; - image_desc_t *image_desc; + uintptr_t config_base = 0UL; + image_desc_t *desc; image_desc_t arm_tb_fw_info = { .image_id = TB_FW_CONFIG_ID, @@ -148,12 +148,11 @@ void arm_load_tb_fw_config(void) tb_fw_cfg_dtb_size = (size_t)arm_tb_fw_info.image_info.image_max_size; /* The BL2 ep_info arg0 is modified to point to TB_FW_CONFIG */ - image_desc = bl1_plat_get_image_desc(BL2_IMAGE_ID); - assert(image_desc != NULL); - image_desc->ep_info.args.arg0 = config_base; + desc = bl1_plat_get_image_desc(BL2_IMAGE_ID); + assert(desc != NULL); + desc->ep_info.args.arg0 = config_base; - INFO("BL1: TB_FW_CONFIG loaded at address = %p\n", - (void *) config_base); + INFO("BL1: TB_FW_CONFIG loaded at address = 0x%lx\n", config_base); #if TRUSTED_BOARD_BOOT && defined(DYN_DISABLE_AUTH) int tb_fw_node; @@ -240,7 +239,7 @@ void arm_bl2_dyn_cfg_init(void) */ if (config_ids[i] != HW_CONFIG_ID) { - if (check_uptr_overflow(image_base, image_size) != 0) + if (check_uptr_overflow(image_base, image_size)) continue; /* Ensure the configs don't overlap with BL31 */