Skip to content

Commit

Permalink
riscv: Avoid kgdb.h including gdb_xml.h to solve unused-const-variabl…
Browse files Browse the repository at this point in the history
…e 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>
  • Loading branch information
Vincent Chen authored and Palmer Dabbelt committed Jul 10, 2020
1 parent def0aa2 commit 70ee573
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions arch/riscv/include/asm/gdb_xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#ifndef __ASM_GDB_XML_H_
#define __ASM_GDB_XML_H_

#define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature
static const char riscv_gdb_stub_feature[64] =
const char riscv_gdb_stub_feature[64] =
"PacketSize=800;qXfer:features:read+;";

static const char gdb_xfer_read_target[31] = "qXfer:features:read:target.xml:";
Expand Down
4 changes: 3 additions & 1 deletion arch/riscv/include/asm/kgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ static inline void arch_kgdb_breakpoint(void)
#define DBG_REG_BADADDR_OFF 34
#define DBG_REG_CAUSE_OFF 35

#include <asm/gdb_xml.h>
extern const char riscv_gdb_stub_feature[64];

#define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature

#endif
#endif

0 comments on commit 70ee573

Please sign in to comment.