Skip to content

Commit

Permalink
x86, kprobes: remove sparse warnings from x86
Browse files Browse the repository at this point in the history
arch/x86/kernel/kprobes.c:584:16: warning: symbol 'kretprobe_trampoline_holder' was not declared. Should it be static?
arch/x86/kernel/kprobes.c:676:6: warning: symbol 'trampoline_handler' was not declared. Should it be static?

Make them static and add the __used attribute, approach taken from the
arm kprobes implementation.

kretprobe_trampoline_holder uses inline assemly to define the global
symbol kretprobe_trampoline, but nothing ever calls the holder explicitly.

trampoline handler is only called from inline assembly in the same file,
mark it used and static.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Feb 19, 2008
1 parent 08cd93f commit f1452d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
* When a retprobed function returns, this code saves registers and
* calls trampoline_handler() runs, which calls the kretprobe's handler.
*/
void __kprobes kretprobe_trampoline_holder(void)
static void __used __kprobes kretprobe_trampoline_holder(void)
{
asm volatile (
".global kretprobe_trampoline\n"
Expand Down Expand Up @@ -673,7 +673,7 @@ void __kprobes kretprobe_trampoline_holder(void)
/*
* Called from kretprobe_trampoline
*/
void * __kprobes trampoline_handler(struct pt_regs *regs)
static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
{
struct kretprobe_instance *ri = NULL;
struct hlist_head *head, empty_rp;
Expand Down

0 comments on commit f1452d4

Please sign in to comment.