fix(versal): typecast operands to match data type
This corrects the MISRA violation C2012-10.3:
The value of an expression shall not be assigned to an object with a
narrower essential type or of a different essential type category.
The condition is explicitly checked against 0U, appending 'U' and
typecasting for unsigned comparison.
Change-Id: Ie82297e7eb5faa5d45b1a613c59516052e0c5ecb
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
diff --git a/plat/xilinx/versal/pm_service/pm_client.c b/plat/xilinx/versal/pm_service/pm_client.c
index 159b19a..de2cac8 100644
--- a/plat/xilinx/versal/pm_service/pm_client.c
+++ b/plat/xilinx/versal/pm_service/pm_client.c
@@ -233,8 +233,9 @@
static uint32_t pm_get_cpuid(uint32_t nid)
{
uint32_t ret = UNDEFINED_CPUID;
+ uint32_t i;
- for (size_t i = 0U; i < ARRAY_SIZE(pm_procs_all); i++) {
+ for (i = 0U; i < ARRAY_SIZE(pm_procs_all); i++) {
if (pm_procs_all[i].node_id == nid) {
ret = i;
break;