Skip to content

Commit 1b9c3dd

Browse files
arndbRussell King (Oracle)
authored andcommitted
ARM: 9303/1: kprobes: avoid missing-declaration warnings
checker_stack_use_t32strd() and kprobe_handler() can be made static since they are not used from other files, while coverage_start_registers() and __kprobes_test_case() are used from assembler code, and just need a declaration to avoid a warning with the global definition. arch/arm/probes/kprobes/checkers-common.c:43:18: error: no previous prototype for 'checker_stack_use_t32strd' arch/arm/probes/kprobes/core.c:236:16: error: no previous prototype for 'kprobe_handler' arch/arm/probes/kprobes/test-core.c:723:10: error: no previous prototype for 'coverage_start_registers' arch/arm/probes/kprobes/test-core.c:918:14: error: no previous prototype for '__kprobes_test_case_start' arch/arm/probes/kprobes/test-core.c:952:14: error: no previous prototype for '__kprobes_test_case_end_16' arch/arm/probes/kprobes/test-core.c:967:14: error: no previous prototype for '__kprobes_test_case_end_32' Fixes: 6624cf6 ("ARM: kprobes: collects stack consumption for store instructions") Fixes: 454f3e1 ("ARM/kprobes: Remove jprobe arm implementation") Acked-by: Masami Hiramatsu (Google) <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 4b026ca commit 1b9c3dd

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

arch/arm/probes/kprobes/checkers-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ enum probes_insn checker_stack_use_imm_0xx(probes_opcode_t insn,
4040
* Different from other insn uses imm8, the real addressing offset of
4141
* STRD in T32 encoding should be imm8 * 4. See ARMARM description.
4242
*/
43-
enum probes_insn checker_stack_use_t32strd(probes_opcode_t insn,
43+
static enum probes_insn checker_stack_use_t32strd(probes_opcode_t insn,
4444
struct arch_probes_insn *asi,
4545
const struct decode_header *h)
4646
{

arch/arm/probes/kprobes/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb)
233233
* kprobe, and that level is reserved for user kprobe handlers, so we can't
234234
* risk encountering a new kprobe in an interrupt handler.
235235
*/
236-
void __kprobes kprobe_handler(struct pt_regs *regs)
236+
static void __kprobes kprobe_handler(struct pt_regs *regs)
237237
{
238238
struct kprobe *p, *cur;
239239
struct kprobe_ctlblk *kcb;

arch/arm/probes/kprobes/opt-arm.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ __arch_remove_optimized_kprobe(struct optimized_kprobe *op, int dirty)
145145
}
146146
}
147147

148-
extern void kprobe_handler(struct pt_regs *regs);
149-
150148
static void
151149
optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
152150
{

arch/arm/probes/kprobes/test-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ static const char coverage_register_lookup[16] = {
720720
[REG_TYPE_NOSPPCX] = COVERAGE_ANY_REG | COVERAGE_SP,
721721
};
722722

723-
unsigned coverage_start_registers(const struct decode_header *h)
723+
static unsigned coverage_start_registers(const struct decode_header *h)
724724
{
725725
unsigned regs = 0;
726726
int i;

arch/arm/probes/kprobes/test-core.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,3 +454,7 @@ void kprobe_thumb32_test_cases(void);
454454
#else
455455
void kprobe_arm_test_cases(void);
456456
#endif
457+
458+
void __kprobes_test_case_start(void);
459+
void __kprobes_test_case_end_16(void);
460+
void __kprobes_test_case_end_32(void);

0 commit comments

Comments
 (0)