fix(xilinx): resolve misra rule 10.4 violations
Fixed below MISRA violation:
- MISRA Violation: MISRA-C:2012 R.10.4:
- Both operands of an operator in which the usual arithmetic conversions
are performed shall have the same essential type category.
- Fix:
- Made data type same for both the operands.
Change-Id: I0cea19477f3c10265d95ea1d5d2ea151dbf174bb
Signed-off-by: Devanshi Chauhan Alpeshbhai <devanshi.chauhanalpeshbhai@amd.com>
diff --git a/plat/xilinx/common/pm_service/pm_ipi.c b/plat/xilinx/common/pm_service/pm_ipi.c
index ea553e8..610acc7 100644
--- a/plat/xilinx/common/pm_service/pm_ipi.c
+++ b/plat/xilinx/common/pm_service/pm_ipi.c
@@ -299,12 +299,12 @@
uint32_t pm_ipi_irq_status(const struct pm_proc *proc)
{
- int32_t ret;
+ uint32_t ret;
uint32_t result = (uint32_t)PM_RET_SUCCESS;
ret = ipi_mb_enquire_status(proc->ipi->local_ipi_id,
proc->ipi->remote_ipi_id);
- if (((uint32_t)ret & IPI_MB_STATUS_RECV_PENDING) != 0U) {
+ if ((ret & IPI_MB_STATUS_RECV_PENDING) != 0U) {
result = IPI_MB_STATUS_RECV_PENDING;
}
diff --git a/plat/xilinx/common/pm_service/pm_svc_main.c b/plat/xilinx/common/pm_service/pm_svc_main.c
index c926d2e..993a03a 100644
--- a/plat/xilinx/common/pm_service/pm_svc_main.c
+++ b/plat/xilinx/common/pm_service/pm_svc_main.c
@@ -132,7 +132,7 @@
(void)cookie;
uint32_t payload[4] = {0};
enum pm_ret_status ret;
- int ipi_status, i;
+ uint32_t ipi_status, i;
VERBOSE("Received IPI FIQ from firmware\n");
@@ -140,11 +140,11 @@
(void)plat_ic_acknowledge_interrupt();
/* Check status register for each IPI except PMC */
- for (i = (int32_t)IPI_ID_APU; i <= IPI_ID_5; i++) {
- ipi_status = ipi_mb_enquire_status(IPI_ID_APU, (uint32_t)i);
+ for (i = IPI_ID_APU; i <= IPI_ID_5; i++) {
+ ipi_status = ipi_mb_enquire_status(IPI_ID_APU, i);
/* If any agent other than PMC has generated IPI FIQ then send SGI to mbox driver */
- if ((uint32_t)ipi_status & IPI_MB_STATUS_RECV_PENDING) {
+ if (ipi_status & IPI_MB_STATUS_RECV_PENDING) {
plat_ic_raise_ns_sgi((int)MBOX_SGI_SHARED_IPI, read_mpidr_el1());
break;
}
@@ -152,7 +152,7 @@
/* If PMC has not generated interrupt then end ISR */
ipi_status = ipi_mb_enquire_status(IPI_ID_APU, IPI_ID_PMC);
- if (((uint32_t)ipi_status & IPI_MB_STATUS_RECV_PENDING) == 0U) {
+ if ((ipi_status & IPI_MB_STATUS_RECV_PENDING) == 0U) {
plat_ic_end_of_interrupt(id);
goto exit_label;
}
@@ -426,7 +426,7 @@
enum pm_ret_status ret;
ret = pm_get_callbackdata(result, ARRAY_SIZE(result), security_flag, 1U);
- if (ret != 0) {
+ if (ret != PM_RET_SUCCESS) {
result[0] = (uint32_t)ret;
}