Browse Source

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
pull/1978/merge
Abhyuday Godhasara 3 years ago
parent
commit
fa98d7f2f8
  1. 8
      plat/xilinx/versal/pm_service/pm_client.c
  2. 4
      plat/xilinx/versal/pm_service/pm_svc_main.c

8
plat/xilinx/versal/pm_service/pm_client.c

@ -122,7 +122,7 @@ static void pm_client_set_wakeup_sources(uint32_t node_id)
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 @@ static void pm_client_set_wakeup_sources(uint32_t node_id)
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 @@ static void pm_client_set_wakeup_sources(uint32_t node_id)
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);
}
}
}

4
plat/xilinx/versal/pm_service/pm_svc_main.c

@ -350,7 +350,7 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
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 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
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:

Loading…
Cancel
Save