[PATCH master 4/5] ARM: i.MX8M: silence warning accessing bootrom log in zero page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We don't compile with --param=min-pagesize=0, so GCC will complain about
dereference of (void *)0x9e0, even if done through a volatile pointer.

We know this to be okay, because either we run in PBL before MMU is set
up or we run in barebox proper and zero_page_access() will be
temporarily disabling trapping by the null page. Thus hide the access
from the compiler to silence the warning.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 arch/arm/mach-imx/romapi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/romapi.c b/arch/arm/mach-imx/romapi.c
index 0936c855fd03..b241e633ea01 100644
--- a/arch/arm/mach-imx/romapi.c
+++ b/arch/arm/mach-imx/romapi.c
@@ -57,10 +57,13 @@ int imx8mn_bootrom_load_image(void)
 const u32 *imx8m_get_bootrom_log(void)
 {
 	if (current_el() == 3) {
+		ulong *rom_log_addr_offset = (void *)0x9e0;
 		ulong rom_log_addr;
 
+		OPTIMIZER_HIDE_VAR(rom_log_addr_offset);
+
 		zero_page_access();
-		rom_log_addr = readl(IOMEM(0x9e0));
+		rom_log_addr = *rom_log_addr_offset;
 		zero_page_faulting();
 
 		if (rom_log_addr < MX8M_OCRAM_BASE_ADDR ||
-- 
2.30.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux