linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kprobes: remove sparse warnings from x86
@ 2008-02-13 23:30 Harvey Harrison
  2008-02-14 15:08 ` Masami Hiramatsu
  0 siblings, 1 reply; 5+ messages in thread
From: Harvey Harrison @ 2008-02-13 23:30 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, LKML

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>
---
 arch/x86/kernel/kprobes.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index a99e764..34a5912 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -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"
@@ -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;
-- 
1.5.4.1.1278.gc75be




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] kprobes: remove sparse warnings from x86
  2008-02-13 23:30 [PATCH] kprobes: remove sparse warnings from x86 Harvey Harrison
@ 2008-02-14 15:08 ` Masami Hiramatsu
  2008-02-14 18:01   ` Harvey Harrison
  0 siblings, 1 reply; 5+ messages in thread
From: Masami Hiramatsu @ 2008-02-14 15:08 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, LKML

Harvey Harrison :
> 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>

It looks good to me.

Acked-by: Masami Hiramatsu <mhiramat@redhat.com>

Thank you,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kprobes: remove sparse warnings from x86
  2008-02-14 15:08 ` Masami Hiramatsu
@ 2008-02-14 18:01   ` Harvey Harrison
  2008-02-15  0:23     ` Ingo Molnar
  2008-02-17 16:59     ` Ingo Molnar
  0 siblings, 2 replies; 5+ messages in thread
From: Harvey Harrison @ 2008-02-14 18:01 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Thomas Gleixner, H. Peter Anvin, LKML, Masami Hiramatsu

On Thu, 2008-02-14 at 10:08 -0500, Masami Hiramatsu wrote:
> Harvey Harrison :
> > 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>
> 
> It looks good to me.
> 
> Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
> 
> Thank you,
> 

Ingo, could you take this in x86.git?

Harvey


From: Harvey Harrison <harvey.harrison@gmail.com>
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.

Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 arch/x86/kernel/kprobes.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index a99e764..34a5912 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -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"
@@ -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;
-- 
1.5.4.1.1278.gc75be




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] kprobes: remove sparse warnings from x86
  2008-02-14 18:01   ` Harvey Harrison
@ 2008-02-15  0:23     ` Ingo Molnar
  2008-02-17 16:59     ` Ingo Molnar
  1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-02-15  0:23 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Thomas Gleixner, H. Peter Anvin, LKML, Masami Hiramatsu


* Harvey Harrison <harvey.harrison@gmail.com> wrote:

> > > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> > 
> > It looks good to me.
> > 
> > Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
> > 
> > Thank you,
> 
> Ingo, could you take this in x86.git?

thanks Harvey, applied.

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kprobes: remove sparse warnings from x86
  2008-02-14 18:01   ` Harvey Harrison
  2008-02-15  0:23     ` Ingo Molnar
@ 2008-02-17 16:59     ` Ingo Molnar
  1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-02-17 16:59 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Thomas Gleixner, H. Peter Anvin, LKML, Masami Hiramatsu


* Harvey Harrison <harvey.harrison@gmail.com> wrote:

> Ingo, could you take this in x86.git?

yeah - and Thomas has beaten me at picking it up :-)

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-02-17 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-13 23:30 [PATCH] kprobes: remove sparse warnings from x86 Harvey Harrison
2008-02-14 15:08 ` Masami Hiramatsu
2008-02-14 18:01   ` Harvey Harrison
2008-02-15  0:23     ` Ingo Molnar
2008-02-17 16:59     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).