public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ftrace/samples: Add missing prototype for my_direct_func
@ 2021-11-01 15:20 Jiri Olsa
  2021-11-01 15:31 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2021-11-01 15:20 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: kernel test robot, lkml

There's compilation fail reported kernel test robot for W=1 build:

  >> samples/ftrace/ftrace-direct-multi.c:8:6: warning: no previous
  prototype for function 'my_direct_func' [-Wmissing-prototypes]
     void my_direct_func(unsigned long ip)

The inlined assembly is used outside function, so we can't make
my_direct_func static and pass it as asm input argument.

However my_tramp is already extern so I think there's no problem
keeping my_direct_func extern as well and just add its prototype.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 5fae941b9a6f ("ftrace/samples: Add multi direct interface test module")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 samples/ftrace/ftrace-direct-multi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/samples/ftrace/ftrace-direct-multi.c b/samples/ftrace/ftrace-direct-multi.c
index 2a5b1fb7ac14..e0ccf43da0c9 100644
--- a/samples/ftrace/ftrace-direct-multi.c
+++ b/samples/ftrace/ftrace-direct-multi.c
@@ -10,6 +10,7 @@ void my_direct_func(unsigned long ip)
 	trace_printk("ip %lx\n", ip);
 }
 
+extern void my_direct_func(unsigned long ip);
 extern void my_tramp(void *);
 
 asm (
-- 
2.32.0


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

* Re: [PATCH] ftrace/samples: Add missing prototype for my_direct_func
  2021-11-01 15:20 [PATCH] ftrace/samples: Add missing prototype for my_direct_func Jiri Olsa
@ 2021-11-01 15:31 ` Steven Rostedt
  2021-11-01 15:39   ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2021-11-01 15:31 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: Ingo Molnar, kernel test robot, lkml

On Mon,  1 Nov 2021 16:20:02 +0100
Jiri Olsa <jolsa@redhat.com> wrote:

> There's compilation fail reported kernel test robot for W=1 build:
> 
>   >> samples/ftrace/ftrace-direct-multi.c:8:6: warning: no previous  
>   prototype for function 'my_direct_func' [-Wmissing-prototypes]
>      void my_direct_func(unsigned long ip)
> 
> The inlined assembly is used outside function, so we can't make
> my_direct_func static and pass it as asm input argument.
> 
> However my_tramp is already extern so I think there's no problem
> keeping my_direct_func extern as well and just add its prototype.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 5fae941b9a6f ("ftrace/samples: Add multi direct interface test module")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  samples/ftrace/ftrace-direct-multi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/samples/ftrace/ftrace-direct-multi.c b/samples/ftrace/ftrace-direct-multi.c
> index 2a5b1fb7ac14..e0ccf43da0c9 100644
> --- a/samples/ftrace/ftrace-direct-multi.c
> +++ b/samples/ftrace/ftrace-direct-multi.c
> @@ -10,6 +10,7 @@ void my_direct_func(unsigned long ip)
>  	trace_printk("ip %lx\n", ip);
>  }
>  
> +extern void my_direct_func(unsigned long ip);
>  extern void my_tramp(void *);

Except that I believe that the prototype must come before it is used.

I don't think this will fix the warning.

-- Steve


>  
>  asm (


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

* Re: [PATCH] ftrace/samples: Add missing prototype for my_direct_func
  2021-11-01 15:31 ` Steven Rostedt
@ 2021-11-01 15:39   ` Jiri Olsa
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2021-11-01 15:39 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Ingo Molnar, kernel test robot, lkml

On Mon, Nov 01, 2021 at 11:31:27AM -0400, Steven Rostedt wrote:
> On Mon,  1 Nov 2021 16:20:02 +0100
> Jiri Olsa <jolsa@redhat.com> wrote:
> 
> > There's compilation fail reported kernel test robot for W=1 build:
> > 
> >   >> samples/ftrace/ftrace-direct-multi.c:8:6: warning: no previous  
> >   prototype for function 'my_direct_func' [-Wmissing-prototypes]
> >      void my_direct_func(unsigned long ip)
> > 
> > The inlined assembly is used outside function, so we can't make
> > my_direct_func static and pass it as asm input argument.
> > 
> > However my_tramp is already extern so I think there's no problem
> > keeping my_direct_func extern as well and just add its prototype.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Fixes: 5fae941b9a6f ("ftrace/samples: Add multi direct interface test module")
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  samples/ftrace/ftrace-direct-multi.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/samples/ftrace/ftrace-direct-multi.c b/samples/ftrace/ftrace-direct-multi.c
> > index 2a5b1fb7ac14..e0ccf43da0c9 100644
> > --- a/samples/ftrace/ftrace-direct-multi.c
> > +++ b/samples/ftrace/ftrace-direct-multi.c
> > @@ -10,6 +10,7 @@ void my_direct_func(unsigned long ip)
> >  	trace_printk("ip %lx\n", ip);
> >  }
> >  
> > +extern void my_direct_func(unsigned long ip);
> >  extern void my_tramp(void *);
> 
> Except that I believe that the prototype must come before it is used.
> 
> I don't think this will fix the warning.

ugh, sry.. v2 posted

jirka

> 
> -- Steve
> 
> 
> >  
> >  asm (
> 


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

end of thread, other threads:[~2021-11-01 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-01 15:20 [PATCH] ftrace/samples: Add missing prototype for my_direct_func Jiri Olsa
2021-11-01 15:31 ` Steven Rostedt
2021-11-01 15:39   ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox