2021-12-18 17:57:57

by kernel test robot

[permalink] [raw]
Subject: samples/ftrace/ftrace-direct-multi-modify.c:7:6: warning: no previous prototype for function 'my_direct_func1'

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9eaa88c7036eda3f6c215f87ca693594cf90559b
commit: e1067a07cfbc5a36abad3752fafe4c79e06db1bb ftrace/samples: Add module to test multi direct modify interface
date: 9 days ago
config: x86_64-randconfig-a001-20211219 (https://download.01.org/0day-ci/archive/20211219/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4c9e31a4814592bbda7153833e46728dc7b21100)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1067a07cfbc5a36abad3752fafe4c79e06db1bb
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e1067a07cfbc5a36abad3752fafe4c79e06db1bb
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash samples/ftrace/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> samples/ftrace/ftrace-direct-multi-modify.c:7:6: warning: no previous prototype for function 'my_direct_func1' [-Wmissing-prototypes]
void my_direct_func1(unsigned long ip)
^
samples/ftrace/ftrace-direct-multi-modify.c:7:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void my_direct_func1(unsigned long ip)
^
static
>> samples/ftrace/ftrace-direct-multi-modify.c:12:6: warning: no previous prototype for function 'my_direct_func2' [-Wmissing-prototypes]
void my_direct_func2(unsigned long ip)
^
samples/ftrace/ftrace-direct-multi-modify.c:12:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void my_direct_func2(unsigned long ip)
^
static
2 warnings generated.


vim +/my_direct_func1 +7 samples/ftrace/ftrace-direct-multi-modify.c

6
> 7 void my_direct_func1(unsigned long ip)
8 {
9 trace_printk("my direct func1 ip %lx\n", ip);
10 }
11
> 12 void my_direct_func2(unsigned long ip)
13 {
14 trace_printk("my direct func2 ip %lx\n", ip);
15 }
16

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


2021-12-18 22:59:05

by Jiri Olsa

[permalink] [raw]
Subject: Re: samples/ftrace/ftrace-direct-multi-modify.c:7:6: warning: no previous prototype for function 'my_direct_func1'

On Sun, Dec 19, 2021 at 01:57:29AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 9eaa88c7036eda3f6c215f87ca693594cf90559b
> commit: e1067a07cfbc5a36abad3752fafe4c79e06db1bb ftrace/samples: Add module to test multi direct modify interface
> date: 9 days ago
> config: x86_64-randconfig-a001-20211219 (https://download.01.org/0day-ci/archive/20211219/[email protected]/config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4c9e31a4814592bbda7153833e46728dc7b21100)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1067a07cfbc5a36abad3752fafe4c79e06db1bb
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout e1067a07cfbc5a36abad3752fafe4c79e06db1bb
> # save the config file to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash samples/ftrace/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <[email protected]>
>
> All warnings (new ones prefixed by >>):
>
> >> samples/ftrace/ftrace-direct-multi-modify.c:7:6: warning: no previous prototype for function 'my_direct_func1' [-Wmissing-prototypes]
> void my_direct_func1(unsigned long ip)
> ^
> samples/ftrace/ftrace-direct-multi-modify.c:7:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> void my_direct_func1(unsigned long ip)
> ^
> static
> >> samples/ftrace/ftrace-direct-multi-modify.c:12:6: warning: no previous prototype for function 'my_direct_func2' [-Wmissing-prototypes]
> void my_direct_func2(unsigned long ip)
> ^
> samples/ftrace/ftrace-direct-multi-modify.c:12:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> void my_direct_func2(unsigned long ip)
> ^
> static
> 2 warnings generated.

ugh, not again.. of course :-\ will send the fix

thanks,
jirka

>
>
> vim +/my_direct_func1 +7 samples/ftrace/ftrace-direct-multi-modify.c
>
> 6
> > 7 void my_direct_func1(unsigned long ip)
> 8 {
> 9 trace_printk("my direct func1 ip %lx\n", ip);
> 10 }
> 11
> > 12 void my_direct_func2(unsigned long ip)
> 13 {
> 14 trace_printk("my direct func2 ip %lx\n", ip);
> 15 }
> 16
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/[email protected]
>