fix(plat/xilinx/versal): resolve misra R10.6 in pm services
MISRA Violation: MISRA-C:2012 R.10.6
- The value of a composite expression shall not be assigned to an object
with wider essential type.
Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I67ac6b6b4b643f57e76a435345540e241c9a88b9
diff --git a/plat/xilinx/versal/pm_service/pm_client.c b/plat/xilinx/versal/pm_service/pm_client.c
index 47306ec..5f20c3f 100644
--- a/plat/xilinx/versal/pm_service/pm_client.c
+++ b/plat/xilinx/versal/pm_service/pm_client.c
@@ -122,7 +122,7 @@
uint8_t pm_wakeup_nodes_set[XPM_NODEIDX_DEV_MAX];
uintptr_t isenabler1 = PLAT_VERSAL_GICD_BASE + GICD_ISENABLER + 4;
- zeromem(&pm_wakeup_nodes_set, sizeof(pm_wakeup_nodes_set));
+ zeromem(&pm_wakeup_nodes_set, (u_register_t)sizeof(pm_wakeup_nodes_set));
for (reg_num = 0; reg_num < NUM_GICD_ISENABLER; reg_num++) {
uint32_t base_irq = reg_num << ISENABLER_SHIFT;
@@ -134,8 +134,8 @@
while (reg) {
enum pm_device_node_idx node_idx;
- uint32_t idx, ret, irq, lowest_set = reg & (-reg);
-
+ uint32_t idx, irq, lowest_set = reg & (-reg);
+ enum pm_ret_status ret;
idx = __builtin_ctz(lowest_set);
irq = base_irq + idx;
@@ -153,7 +153,7 @@
ret = pm_set_wakeup_source(node_id,
device_id, 1,
SECURE_FLAG);
- pm_wakeup_nodes_set[node_idx] = !ret;
+ pm_wakeup_nodes_set[node_idx] = (uint8_t)(!ret);
}
}
}
diff --git a/plat/xilinx/versal/pm_service/pm_svc_main.c b/plat/xilinx/versal/pm_service/pm_svc_main.c
index 6a79fc5..c7ca30a 100644
--- a/plat/xilinx/versal/pm_service/pm_svc_main.c
+++ b/plat/xilinx/versal/pm_service/pm_svc_main.c
@@ -350,7 +350,7 @@
ret = pm_clock_get_rate(pm_arg[0], rate, security_flag);
SMC_RET2(handle, (uint64_t)ret | ((uint64_t)rate[0] << 32),
- rate[1]);
+ (uint64_t)rate[1] | ((uint64_t)0U << 32));
}
case PM_PLL_SET_PARAMETER:
@@ -389,7 +389,7 @@
ret = pm_get_chipid(result, security_flag);
SMC_RET2(handle, (uint64_t)ret | ((uint64_t)result[0] << 32),
- result[1]);
+ (uint64_t)result[1] | ((uint64_t)0U << 32));
}
case PM_FEATURE_CHECK: