kprobes: remove sparse warnings from x86
PATCH 1/1 kprobes: remove sparse warnings from x86
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.
--- arch/x86/kernel/kprobes.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/kprobes.c +2 -2
@@ -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 ) { asmvolatile ( ".global kretprobe_trampoline\n"
@@ -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;
Signature · 1 line
1.5.4.1.1278.gc75be
Harvey Harrison :
Quoted 6 lines
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
__usedattribute, approach taken from the arm kprobes implementation.
Quoted 7 lines
kretprobe_trampoline_holderuses inline assemly to define the global symbolkretprobe_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 <[email protected]>
It looks good to me.
Thank you,
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America) Inc. Software Solutions Division e-mail: [email protected]
Harvey Harrison
Acked-by Masami HiramatsuQuoted 13 lines · Masami Hiramatsu
Harvey Harrison :
Quoted 12 lines
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
__usedattribute, approach taken from the arm kprobes implementation.
kretprobe_trampoline_holderuses inline assemly to define the global symbolkretprobe_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.
Quoted 8 lines
Quoted 1 line
Signed-off-by Harvey Harrison <[email protected]>It looks good to me.
Acked-by Masami Hiramatsu <[email protected]>Thank you,
Ingo, could you take this in x86.git?
Harvey
From: Harvey Harrison <[email protected]>
Subject: [PATCH] kprobes: remove sparse warnings from x86
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.
--- arch/x86/kernel/kprobes.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/kprobes.c +2 -2
@@ -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 ) { asmvolatile ( ".global kretprobe_trampoline\n"
@@ -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;
Signature · 1 line
1.5.4.1.1278.gc75be
Quoted 9 lines · Harvey Harrison
Quoted 7 lines
Quoted 1 line
Signed-off-by Harvey Harrison <[email protected]>It looks good to me.
Acked-by Masami Hiramatsu <[email protected]>Thank you,
Ingo, could you take this in x86.git?
thanks Harvey, applied.
Ingo
Quoted 1 line · Harvey Harrison
Ingo, could you take this in x86.git?
yeah - and Thomas has beaten me at picking it up :-)
Ingo