diff mbox series

[3/4] parisc: Use absolute_pointer for memcmp on fixed memory location

Message ID 20210912160149.2227137-4-linux@roeck-us.net
State New
Headers show
Series Introduce and use absolute_pointer macro | expand

Commit Message

Guenter Roeck Sept. 12, 2021, 4:01 p.m. UTC
parisc:allmodconfig fails to build with the following error
when using gcc 11.x.

arch/parisc/kernel/setup.c: In function 'start_parisc':
arch/parisc/kernel/setup.c:389:28: error:
	'__builtin_memcmp_eq' specified bound 8 exceeds source size 0

Avoid the problem by using absolute_pointer() when providing a memory
address to memcmp().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 arch/parisc/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index cceb09855e03..4e13345b6581 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -384,7 +384,7 @@  void __init start_parisc(void)
 	struct pdc_coproc_cfg coproc_cfg;
 
 	/* check QEMU/SeaBIOS marker in PAGE0 */
-	running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0);
+	running_on_qemu = (memcmp(absolute_pointer(&PAGE0->pad0), "SeaBIOS", 8) == 0);
 
 	cpunum = smp_processor_id();