Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

riscv: Avoid kgdb.h including gdb_xml.h to solve unused-const-variable warning

The constant arrays in gdb_xml.h are only used in arch/riscv/kernel/kgdb.c,
but other c files may include the gdb_xml.h indirectly via including the
kgdb.h. Hence, It will cause many unused-const-variable warnings. This
patch makes the kgdb.h not to include the gdb_xml.h to solve this problem.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>

authored by

Vincent Chen and committed by
Palmer Dabbelt
70ee5731 def0aa21

+4 -3
+1 -2
arch/riscv/include/asm/gdb_xml.h
··· 3 3 #ifndef __ASM_GDB_XML_H_ 4 4 #define __ASM_GDB_XML_H_ 5 5 6 - #define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature 7 - static const char riscv_gdb_stub_feature[64] = 6 + const char riscv_gdb_stub_feature[64] = 8 7 "PacketSize=800;qXfer:features:read+;"; 9 8 10 9 static const char gdb_xfer_read_target[31] = "qXfer:features:read:target.xml:";
+3 -1
arch/riscv/include/asm/kgdb.h
··· 105 105 #define DBG_REG_BADADDR_OFF 34 106 106 #define DBG_REG_CAUSE_OFF 35 107 107 108 - #include <asm/gdb_xml.h> 108 + extern const char riscv_gdb_stub_feature[64]; 109 + 110 + #define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature 109 111 110 112 #endif 111 113 #endif