Re: [PATCH] smp: Modify 'int' to 'bool' in smp_call_function_single()

From: kernel test robot
Date: Wed Jan 20 2021 - 07:13:11 EST


Hi Yejune,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.11-rc4 next-20210120]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Yejune-Deng/smp-Modify-int-to-bool-in-smp_call_function_single/20210120-154807
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 45dfb8a5659ad286c28fa59008271dbc4e5e3f2d
config: nds32-defconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.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://github.com/0day-ci/linux/commit/856e1f8de78bcf1c02ffa0f33a5047172bd0d0c9
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yejune-Deng/smp-Modify-int-to-bool-in-smp_call_function_single/20210120-154807
git checkout 856e1f8de78bcf1c02ffa0f33a5047172bd0d0c9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> kernel/up.c:12:5: error: conflicting types for 'smp_call_function_single'
12 | int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/interrupt.h:11,
from kernel/up.c:6:
include/linux/smp.h:50:5: note: previous declaration of 'smp_call_function_single' was here
50 | int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:7,
from include/linux/interrupt.h:6,
from kernel/up.c:6:
kernel/up.c:26:15: error: conflicting types for 'smp_call_function_single'
26 | EXPORT_SYMBOL(smp_call_function_single);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym; \
| ^~~
include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:158:29: note: in expansion of macro '_EXPORT_SYMBOL'
158 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
kernel/up.c:26:1: note: in expansion of macro 'EXPORT_SYMBOL'
26 | EXPORT_SYMBOL(smp_call_function_single);
| ^~~~~~~~~~~~~
In file included from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/interrupt.h:11,
from kernel/up.c:6:
include/linux/smp.h:50:5: note: previous declaration of 'smp_call_function_single' was here
50 | int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/up.c:39:6: error: conflicting types for 'on_each_cpu'
39 | void on_each_cpu(smp_call_func_t func, void *info, int wait)
| ^~~~~~~~~~~
In file included from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/interrupt.h:11,
from kernel/up.c:6:
include/linux/smp.h:56:6: note: previous declaration of 'on_each_cpu' was here
56 | void on_each_cpu(smp_call_func_t func, void *info, bool wait);
| ^~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:7,
from include/linux/interrupt.h:6,
from kernel/up.c:6:
kernel/up.c:47:15: error: conflicting types for 'on_each_cpu'
47 | EXPORT_SYMBOL(on_each_cpu);
| ^~~~~~~~~~~
include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym; \
| ^~~
include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:158:29: note: in expansion of macro '_EXPORT_SYMBOL'
158 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
kernel/up.c:47:1: note: in expansion of macro 'EXPORT_SYMBOL'
47 | EXPORT_SYMBOL(on_each_cpu);
| ^~~~~~~~~~~~~
In file included from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/interrupt.h:11,
from kernel/up.c:6:
include/linux/smp.h:56:6: note: previous declaration of 'on_each_cpu' was here
56 | void on_each_cpu(smp_call_func_t func, void *info, bool wait);
| ^~~~~~~~~~~


vim +/smp_call_function_single +12 kernel/up.c

53ce3d956490879 Andrew Morton 2009-01-09 11
53ce3d956490879 Andrew Morton 2009-01-09 @12 int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
53ce3d956490879 Andrew Morton 2009-01-09 13 int wait)
53ce3d956490879 Andrew Morton 2009-01-09 14 {
081192b25c2d462 David Daney 2013-09-11 15 unsigned long flags;
081192b25c2d462 David Daney 2013-09-11 16
1e474b28e78897d Paul E. McKenney 2020-02-05 17 if (cpu != 0)
1e474b28e78897d Paul E. McKenney 2020-02-05 18 return -ENXIO;
93423b8665f43a0 Ingo Molnar 2009-01-11 19
081192b25c2d462 David Daney 2013-09-11 20 local_irq_save(flags);
081192b25c2d462 David Daney 2013-09-11 21 func(info);
081192b25c2d462 David Daney 2013-09-11 22 local_irq_restore(flags);
93423b8665f43a0 Ingo Molnar 2009-01-11 23
53ce3d956490879 Andrew Morton 2009-01-09 24 return 0;
53ce3d956490879 Andrew Morton 2009-01-09 25 }
53ce3d956490879 Andrew Morton 2009-01-09 26 EXPORT_SYMBOL(smp_call_function_single);
fa688207c9db48b David Daney 2013-09-11 27
966a967116e6997 Ying Huang 2017-08-08 28 int smp_call_function_single_async(int cpu, call_single_data_t *csd)
40c01e8bd5575e3 Christoph Hellwig 2013-11-14 29 {
40c01e8bd5575e3 Christoph Hellwig 2013-11-14 30 unsigned long flags;
40c01e8bd5575e3 Christoph Hellwig 2013-11-14 31
40c01e8bd5575e3 Christoph Hellwig 2013-11-14 32 local_irq_save(flags);
40c01e8bd5575e3 Christoph Hellwig 2013-11-14 33 csd->func(csd->info);
40c01e8bd5575e3 Christoph Hellwig 2013-11-14 34 local_irq_restore(flags);
08eed44c7249d38 Jan Kara 2014-02-24 35 return 0;
40c01e8bd5575e3 Christoph Hellwig 2013-11-14 36 }
c46fff2a3b29794 Frederic Weisbecker 2014-02-24 37 EXPORT_SYMBOL(smp_call_function_single_async);
40c01e8bd5575e3 Christoph Hellwig 2013-11-14 38
caa759323c73676 Nadav Amit 2019-06-12 @39 void on_each_cpu(smp_call_func_t func, void *info, int wait)
bff2dc42bcafdd7 David Daney 2013-09-11 40 {
bff2dc42bcafdd7 David Daney 2013-09-11 41 unsigned long flags;
bff2dc42bcafdd7 David Daney 2013-09-11 42
bff2dc42bcafdd7 David Daney 2013-09-11 43 local_irq_save(flags);
bff2dc42bcafdd7 David Daney 2013-09-11 44 func(info);
bff2dc42bcafdd7 David Daney 2013-09-11 45 local_irq_restore(flags);
bff2dc42bcafdd7 David Daney 2013-09-11 46 }
bff2dc42bcafdd7 David Daney 2013-09-11 47 EXPORT_SYMBOL(on_each_cpu);
bff2dc42bcafdd7 David Daney 2013-09-11 48

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip