Dynamic cfg: MISRA fixes
Change-Id: I1d85b76af002b8b672fcaeca94939b7420bc8243
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
diff --git a/plat/arm/common/arm_bl2_setup.c b/plat/arm/common/arm_bl2_setup.c
index 9a51012..7add61d 100644
--- a/plat/arm/common/arm_bl2_setup.c
+++ b/plat/arm/common/arm_bl2_setup.c
@@ -194,7 +194,7 @@
plat_arm_io_setup();
#if LOAD_IMAGE_V2
- if (tb_fw_config != 0)
+ if (tb_fw_config != 0U)
arm_bl2_set_tb_cfg_addr((void *)tb_fw_config);
#endif
}
diff --git a/plat/arm/common/arm_dyn_cfg.c b/plat/arm/common/arm_dyn_cfg.c
index a6fafb8..02f995f 100644
--- a/plat/arm/common/arm_dyn_cfg.c
+++ b/plat/arm/common/arm_dyn_cfg.c
@@ -8,6 +8,7 @@
#include <assert.h>
#include <debug.h>
#include <desc_image_load.h>
+#include <plat_arm.h>
#include <platform.h>
#include <platform_def.h>
#include <string.h>
@@ -38,7 +39,7 @@
VERBOSE("BL1: Loading TB_FW_CONFIG\n");
err = load_auth_image(TB_FW_CONFIG_ID, &arm_tb_fw_info.image_info);
- if (err) {
+ if (err != 0) {
/* Return if TB_FW_CONFIG is not loaded */
VERBOSE("Failed to load TB_FW_CONFIG\n");
return;
@@ -48,7 +49,7 @@
/* 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);
+ assert(image_desc != NULL);
image_desc->ep_info.args.arg0 = config_base;
INFO("BL1: TB_FW_CONFIG loaded at address = %p\n",
@@ -60,7 +61,7 @@
*/
void arm_bl2_set_tb_cfg_addr(void *dtb)
{
- assert(dtb);
+ assert(dtb != NULL);
tb_fw_cfg_dtb = dtb;
}
diff --git a/plat/arm/common/arm_dyn_cfg_helpers.c b/plat/arm/common/arm_dyn_cfg_helpers.c
index afe4453..cfcbf2a 100644
--- a/plat/arm/common/arm_dyn_cfg_helpers.c
+++ b/plat/arm/common/arm_dyn_cfg_helpers.c
@@ -8,6 +8,7 @@
#include <desc_image_load.h>
#include <fdt_wrappers.h>
#include <libfdt.h>
+#include <plat_arm.h>
/*******************************************************************************
* Helper to read the `hw_config` property in config DTB. This function
@@ -31,9 +32,9 @@
{
int err;
- assert(dtb);
- assert(hw_config_addr);
- assert(hw_config_size);
+ assert(dtb != NULL);
+ assert(hw_config_addr != NULL);
+ assert(hw_config_size != NULL);
/* Check if the pointer to DT is correct */
assert(fdt_check_header(dtb) == 0);
@@ -72,8 +73,8 @@
******************************************************************************/
int arm_dyn_tb_fw_cfg_init(void *dtb, int *node)
{
- assert(dtb);
- assert(node);
+ assert(dtb != NULL);
+ assert(node != NULL);
/* Check if the pointer to DT is correct */
if (fdt_check_header(dtb) != 0) {