lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211101113127.19148268@gandalf.local.home>
Date:   Mon, 1 Nov 2021 11:31:27 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Ingo Molnar <mingo@...hat.com>, kernel test robot <lkp@...el.com>,
        lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ftrace/samples: Add missing prototype for
 my_direct_func

On Mon,  1 Nov 2021 16:20:02 +0100
Jiri Olsa <jolsa@...hat.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@...el.com>
> Fixes: 5fae941b9a6f ("ftrace/samples: Add multi direct interface test module")
> Signed-off-by: Jiri Olsa <jolsa@...nel.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 (

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ