Skip to content

Commit 70ee573

Browse files
VincentZWCpalmer-dabbelt
authored andcommitted
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 <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent def0aa2 commit 70ee573

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/riscv/include/asm/gdb_xml.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
#ifndef __ASM_GDB_XML_H_
44
#define __ASM_GDB_XML_H_
55

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] =
87
"PacketSize=800;qXfer:features:read+;";
98

109
static const char gdb_xfer_read_target[31] = "qXfer:features:read:target.xml:";

arch/riscv/include/asm/kgdb.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ static inline void arch_kgdb_breakpoint(void)
105105
#define DBG_REG_BADADDR_OFF 34
106106
#define DBG_REG_CAUSE_OFF 35
107107

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
109111

110112
#endif
111113
#endif

0 commit comments

Comments
 (0)