Re: [mcgrof-next:20211123-sysctl-cleanups 41/41] kernel/kprobes.c:52:1: error: function declaration isn't a prototype

From: Luis Chamberlain
Date: Wed Nov 24 2021 - 09:33:56 EST


On Wed, Nov 24, 2021 at 04:01:56PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20211123-sysctl-cleanups
> head: c18add41d859b4feec081eab6cfd624a5642973d
> commit: c18add41d859b4feec081eab6cfd624a5642973d [41/41] kprobe: move sysctl_kprobes_optimization to kprobes.c
> config: sparc-randconfig-r002-20211123 (https://download.01.org/0day-ci/archive/20211124/202111241540.e3ukBGer-lkp@xxxxxxxxx/config)
> compiler: sparc64-linux-gcc (GCC) 11.2.0
> 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/mcgrof/linux-next.git/commit/?id=c18add41d859b4feec081eab6cfd624a5642973d
> git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
> git fetch --no-tags mcgrof-next 20211123-sysctl-cleanups
> git checkout c18add41d859b4feec081eab6cfd624a5642973d
> # save the config file to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All error/warnings (new ones prefixed by >>):
>
> In file included from include/linux/key.h:17,
> from include/linux/cred.h:13,
> from include/linux/sched/signal.h:10,
> from include/linux/rcuwait.h:6,
> from include/linux/percpu-rwsem.h:7,
> from include/linux/fs.h:33,
> from include/linux/huge_mm.h:8,
> from include/linux/mm.h:717,
> from include/linux/kallsyms.h:13,
> from include/linux/ftrace.h:12,
> from include/linux/kprobes.h:28,
> from kernel/kprobes.c:23:
> include/linux/sysctl.h: In function 'register_sysctl_mount_point':
> include/linux/sysctl.h:270:1: error: expected ';' before '}' token
> 270 | }
> | ^
> kernel/kprobes.c: At top level:
> kernel/kprobes.c:52:1: error: return type defaults to 'int' [-Werror=return-type]
> 52 | kprobe_sysctls_init() do { } while (0)

Fixed. Thanks.

Luis