From 7a5e90a89d91d6662d3e468893e07c91b3a165ee Mon Sep 17 00:00:00 2001 From: Scott Parlane Date: Tue, 6 Sep 2022 10:59:57 +1200 Subject: [PATCH] fix(rk3399): explicitly define the sys_sleep_flag_sram type Recent GCC versions now do array-bounds checking which fails for sys_sleep_flag_sram because the struct is larger than the 8-bytes size that (void *) is This variable is only used in one place as the struct, so it can be defined with the struct type. Resolves: plat/rockchip/px30/drivers/pmu/pmu.c: In function 'rockchip_soc_sys_pwr_dm_suspend': plat/rockchip/px30/drivers/pmu/pmu.c:977:23: error: array subscript 'struct psram_data_t[0]' is partly outside array bounds of 'void[8]' [-Werror=array-bounds] 977 | psram_boot_cfg->pm_flag &= ~PM_WARM_BOOT_BIT; Change-Id: Ifbe42d11d0c7875f6cb23dc0b7ffb3f3f90c55a8 Signed-off-by: Scott Parlane --- plat/rockchip/common/pmusram/cpus_on_fixed_addr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/rockchip/common/pmusram/cpus_on_fixed_addr.h b/plat/rockchip/common/pmusram/cpus_on_fixed_addr.h index 34af29a8a..bcd2a7ce1 100644 --- a/plat/rockchip/common/pmusram/cpus_on_fixed_addr.h +++ b/plat/rockchip/common/pmusram/cpus_on_fixed_addr.h @@ -48,7 +48,7 @@ CASSERT(__builtin_offsetof(struct psram_data_t, ddr_flag) == PSRAM_DT_DDRFLAG, CASSERT(__builtin_offsetof(struct psram_data_t, boot_mpidr) == PSRAM_DT_MPIDR, assert_psram_dt_mpidr_offset_mistmatch); -extern void *sys_sleep_flag_sram; +extern struct psram_data_t sys_sleep_flag_sram; #endif /* __ASSEMBLER__ */