fix(psci): avoid altering function parameters

This corrects the MISRA violation C2012-17.8:
A function parameter should not be modified.
Local variable is declared and used to process the value
from the argument.

Change-Id: Ia757db4903132794623dbf92ff8cecc9b40f170d
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
index 234a195..12d7b7b 100644
--- a/lib/psci/psci_common.c
+++ b/lib/psci/psci_common.c
@@ -1298,7 +1298,8 @@
 
 	/* Need to wait for other cores to shutdown */
 	if (wait_ms != 0U) {
-		while ((wait_ms-- != 0U) && (!psci_is_last_on_cpu(this_cpu_idx))) {
+		for (uint32_t delay_ms = wait_ms; ((delay_ms != 0U) &&
+					(!psci_is_last_on_cpu(this_cpu_idx))); delay_ms--) {
 			mdelay(1U);
 		}