Dynamic cfg: MISRA fixes

Change-Id: I1d85b76af002b8b672fcaeca94939b7420bc8243
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
diff --git a/plat/arm/board/fvp/fvp_bl2_setup.c b/plat/arm/board/fvp/fvp_bl2_setup.c
index 415de05..0a3b67d 100644
--- a/plat/arm/board/fvp/fvp_bl2_setup.c
+++ b/plat/arm/board/fvp/fvp_bl2_setup.c
@@ -7,6 +7,7 @@
 #include <generic_delay_timer.h>
 #include <mmio.h>
 #include <plat_arm.h>
+#include <platform.h>
 #include <sp804_delay_timer.h>
 #include <v2m_def.h>
 #include "fvp_def.h"
diff --git a/plat/arm/board/fvp/fvp_bl31_setup.c b/plat/arm/board/fvp/fvp_bl31_setup.c
index 640dea1..bcba60a 100644
--- a/plat/arm/board/fvp/fvp_bl31_setup.c
+++ b/plat/arm/board/fvp/fvp_bl31_setup.c
@@ -6,6 +6,7 @@
 
 #include <arm_config.h>
 #include <plat_arm.h>
+#include <platform.h>
 #include <smmu_v3.h>
 #include "fvp_private.h"
 
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) {
diff --git a/plat/common/plat_bl1_common.c b/plat/common/plat_bl1_common.c
index a197262..4b1f233 100644
--- a/plat/common/plat_bl1_common.c
+++ b/plat/common/plat_bl1_common.c
@@ -89,7 +89,7 @@
 
 	/* Get the image descriptor */
 	image_desc = bl1_plat_get_image_desc(BL2_IMAGE_ID);
-	assert(image_desc);
+	assert(image_desc != NULL);
 
 	/* Get the entry point info */
 	ep_info = &image_desc->ep_info;