Skip to contentSkip to conversation

Loongarch: KGDB: fix implicit declaration of flush_icache_range()

PATCH In review Randy Dunlap 2 participants 2 messages Aug 29, 2023 LoongArch

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Loongarch: KGDB: fix implicit declaration of flush_icache_range()

Add <asm/cacheflush.h> to prevent a build error:

arch/loongarch/kernel/kgdb.c: In function 'do_single_step':
arch/loongarch/kernel/kgdb.c:440:9: error: implicit declaration of function 'flush_icache_range' [-Werror=implicit-function-declaration]
440 | flush_icache_range(addr, addr + BREAK_INSTR_SIZE);

Fixes 8968eb010689 ("LoongArch: Add basic KGDB & KDB support")
Cc Qing Zhang <[email protected]>
Cc Hui Li <[email protected]>
Cc Binbin Zhou <[email protected]>
Cc Huacai Chen <[email protected]>
Cc WANG Xuerui <[email protected]>
---
 arch/loongarch/kernel/kgdb.c |    1 +
 1 file changed, 1 insertion(+)
arch/loongarch/kernel/kgdb.c +1 -0
diff -- a/arch/loongarch/kernel/kgdb.c b/arch/loongarch/kernel/kgdb.c
@@ -13,6 +13,7 @@
 #include <linux/sched.h>
 #include <linux/smp.h>
 
+#include <asm/cacheflush.h>
 #include <asm/fpu.h>
 #include <asm/lbt.h>
 #include <asm/hw_breakpoint.h>
maintainer
#1 lore raw

Hi, Randy,

Quoted 6 lines · Randy Dunlap

Add <asm/cacheflush.h> to prevent a build error:

arch/loongarch/kernel/kgdb.c: In function 'do_single_step':
arch/loongarch/kernel/kgdb.c:440:9: error: implicit declaration of function 'flush_icache_range' [-Werror=implicit-function-declaration]
440 | flush_icache_range(addr, addr + BREAK_INSTR_SIZE);

Thank you for your fixing, this will be included in linux-next.

Huacai

Quoted 24 lines
Fixes 8968eb010689 ("LoongArch: Add basic KGDB & KDB support")
Cc Qing Zhang <[email protected]>
Cc Hui Li <[email protected]>
Cc Binbin Zhou <[email protected]>
Cc Huacai Chen <[email protected]>
Cc WANG Xuerui <[email protected]>
---
 arch/loongarch/kernel/kgdb.c |    1 +
 1 file changed, 1 insertion(+)

diff -- a/arch/loongarch/kernel/kgdb.c b/arch/loongarch/kernel/kgdb.c

arch/loongarch/kernel/kgdb.c +1 -0
@@ -13,6 +13,7 @@
 #include <linux/sched.h>
 #include <linux/smp.h>
 
+#include <asm/cacheflush.h>
 #include <asm/fpu.h>
 #include <asm/lbt.h>
 #include <asm/hw_breakpoint.h>