plat/arm: Fix MISRA defects in dyn config

Change-Id: Iae6758ca6395560131d1e1a69a1ecfe50ca8bf83
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
This commit is contained in:
Antonio Nino Diaz 2018-10-30 16:32:48 +00:00
parent f21c632138
commit b8a02d53c0
2 changed files with 10 additions and 11 deletions

View File

@ -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 <stddef.h>
#include <stdint.h>
@ -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 */

View File

@ -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 */