]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(versal): initialize the variable with value 0 in pm code
authorNaman Patel <naman.patel@amd.com>
Wed, 16 Nov 2022 09:54:23 +0000 (01:54 -0800)
committerNaman Patel <naman.patel@amd.com>
Thu, 24 Nov 2022 13:25:48 +0000 (05:25 -0800)
Remove zeromem function as the array is already initialized
with value 0.

MISRA Violation: MISRA C-2012 Rule 9.1
- Initialize the array/variable with a value 0 to resolve
the misra warnings in pm_service component.

Signed-off-by: Naman Patel <naman.patel@amd.com>
Change-Id: I1a3d44a7ae4088a3034eb0119d82b99cd4617ccd

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

index ce5e53384ae1ea1cd60cddd6304da84126d9a412..54f4eb285b533a7405da6b7e813a8d1cb642bf4b 100644 (file)
@@ -120,11 +120,9 @@ static void pm_client_set_wakeup_sources(uint32_t node_id)
 {
        uint32_t reg_num;
        uint32_t device_id;
-       uint8_t pm_wakeup_nodes_set[XPM_NODEIDX_DEV_MAX];
+       uint8_t pm_wakeup_nodes_set[XPM_NODEIDX_DEV_MAX] = { 0U };
        uintptr_t isenabler1 = PLAT_VERSAL_GICD_BASE + GICD_ISENABLER + 4;
 
-       zeromem(&pm_wakeup_nodes_set, (u_register_t)sizeof(pm_wakeup_nodes_set));
-
        for (reg_num = 0U; reg_num < NUM_GICD_ISENABLER; reg_num++) {
                uint32_t base_irq = reg_num << ISENABLER_SHIFT;
                uint32_t reg = mmio_read_32(isenabler1 + (reg_num << 2));
index 9eb426a374dac3d5ca2c82f299696f31f1d55e01..c90f9e1c3478916d405fbe2423ddeeaa128189e4 100644 (file)
@@ -160,7 +160,7 @@ static uintptr_t eemi_for_compatibility(uint32_t api_id, uint32_t *pm_arg,
 
        case PM_IOCTL:
        {
-               uint32_t value;
+               uint32_t value = 0U;
 
                ret = pm_api_ioctl(pm_arg[0], pm_arg[1], pm_arg[2],
                                   pm_arg[3], pm_arg[4],