fix(psci): initialise variable to default zero
This corrects the MISRA violation C2012-9.1:
The value of an object with automatic storage duration shall not
be read before it has been set.
Initialized the variable to default value zero.
Change-Id: I225ae4487b05fc47728222765029d6e1fe292ac1
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c
index 4799fc6..00df710 100644
--- a/lib/psci/psci_main.c
+++ b/lib/psci/psci_main.c
@@ -28,7 +28,7 @@
{
int rc;
- entry_point_info_t *ep;
+ entry_point_info_t *ep = NULL;
unsigned int target_idx = (unsigned int)plat_core_pos_by_mpidr(target_cpu);
/* Validate the target CPU */
diff --git a/lib/psci/psci_mem_protect.c b/lib/psci/psci_mem_protect.c
index 68ad705..f6bbacd 100644
--- a/lib/psci/psci_mem_protect.c
+++ b/lib/psci/psci_mem_protect.c
@@ -13,7 +13,7 @@
u_register_t psci_mem_protect(unsigned int enable)
{
- int val;
+ int val = 0;
assert(psci_plat_pm_ops->read_mem_protect != NULL);
assert(psci_plat_pm_ops->write_mem_protect != NULL);