Thread (14 messages) 14 messages, 4 authors, 2021-09-12
STALE1773d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

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

From: Guenter Roeck <linux@roeck-us.net>
Date: 2021-09-12 16:02:22
Also in: linux-alpha, lkml
Subsystem: parisc architecture, the rest · Maintainers: "James E.J. Bottomley", Helge Deller, Linus Torvalds

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 --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();
 
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help