Skip to content

Commit f7fc752

Browse files
VincentZWCpalmer-dabbelt
authored andcommitted
riscv: Fix "no previous prototype" compile warning in kgdb.c file
Some functions are only used in the kgdb.c file. Add static properities to these functions to avoid "no previous prototype" compile warnings Signed-off-by: Vincent Chen <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent fc0c769 commit f7fc752

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/riscv/kernel/kgdb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ DECLARE_INSN(c_beqz, MATCH_C_BEQZ, MASK_C_BEQZ)
4444
DECLARE_INSN(c_bnez, MATCH_C_BNEZ, MASK_C_BNEZ)
4545
DECLARE_INSN(sret, MATCH_SRET, MASK_SRET)
4646

47-
int decode_register_index(unsigned long opcode, int offset)
47+
static int decode_register_index(unsigned long opcode, int offset)
4848
{
4949
return (opcode >> offset) & 0x1F;
5050
}
5151

52-
int decode_register_index_short(unsigned long opcode, int offset)
52+
static int decode_register_index_short(unsigned long opcode, int offset)
5353
{
5454
return ((opcode >> offset) & 0x7) + 8;
5555
}
5656

5757
/* Calculate the new address for after a step */
58-
int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
58+
static int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
5959
{
6060
unsigned long pc = regs->epc;
6161
unsigned long *regs_ptr = (unsigned long *)regs;
@@ -136,7 +136,7 @@ int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
136136
return 0;
137137
}
138138

139-
int do_single_step(struct pt_regs *regs)
139+
static int do_single_step(struct pt_regs *regs)
140140
{
141141
/* Determine where the target instruction will send us to */
142142
unsigned long addr = 0;
@@ -320,7 +320,7 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code,
320320
return err;
321321
}
322322

323-
int kgdb_riscv_kgdbbreak(unsigned long addr)
323+
static int kgdb_riscv_kgdbbreak(unsigned long addr)
324324
{
325325
if (stepped_address == addr)
326326
return KGDB_SW_SINGLE_STEP;

0 commit comments

Comments
 (0)