[frederic-dynticks:isolation/split 9/13] include/linux/cpumask.h:610:26: error: passing argument 1 of 'rcu_nocb_cpumask_update' discards 'const' qualifier from pointer target type

From: kernel test robot
Date: Thu Oct 28 2021 - 00:35:25 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git isolation/split
head: c4988a7256e9e02fb2503a7a0e748ab7b50667b6
commit: 8ea31dca120d4d746a70867c26ca97bb9f4b0471 [9/13] rcu/nocb: Pass a cpumask instead of a single CPU to offload/deoffload
config: openrisc-buildonly-randconfig-r001-20211027 (attached as .config)
compiler: or1k-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/frederic/linux-dynticks.git/commit/?id=8ea31dca120d4d746a70867c26ca97bb9f4b0471
git remote add frederic-dynticks https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
git fetch --no-tags frederic-dynticks isolation/split
git checkout 8ea31dca120d4d746a70867c26ca97bb9f4b0471
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=openrisc

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

All errors (new ones prefixed by >>):

In file included from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
kernel/rcu/rcutorture.c: In function 'rcu_nocb_toggle':
>> include/linux/cpumask.h:610:26: error: passing argument 1 of 'rcu_nocb_cpumask_update' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
610 | #define cpumask_of(cpu) (get_cpu_mask(cpu))
| ~^~~~~~~~~~~~~~~~~~
kernel/rcu/rcutorture.c:1718:49: note: in expansion of macro 'cpumask_of'
1718 | rcu_nocb_cpumask_update(cpumask_of(cpu), true);
| ^~~~~~~~~~
In file included from include/linux/rbtree.h:24,
from include/linux/mm_types.h:10,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
include/linux/rcupdate.h:119:59: note: expected 'struct cpumask *' but argument is of type 'const struct cpumask *'
119 | static inline int rcu_nocb_cpumask_update(struct cpumask *cpumask, bool offload)
| ~~~~~~~~~~~~~~~~^~~~~~~
In file included from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
>> include/linux/cpumask.h:610:26: error: passing argument 1 of 'rcu_nocb_cpumask_update' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
610 | #define cpumask_of(cpu) (get_cpu_mask(cpu))
| ~^~~~~~~~~~~~~~~~~~
kernel/rcu/rcutorture.c:1721:49: note: in expansion of macro 'cpumask_of'
1721 | rcu_nocb_cpumask_update(cpumask_of(cpu), false);
| ^~~~~~~~~~
In file included from include/linux/rbtree.h:24,
from include/linux/mm_types.h:10,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
include/linux/rcupdate.h:119:59: note: expected 'struct cpumask *' but argument is of type 'const struct cpumask *'
119 | static inline int rcu_nocb_cpumask_update(struct cpumask *cpumask, bool offload)
| ~~~~~~~~~~~~~~~~^~~~~~~
cc1: all warnings being treated as errors


vim +610 include/linux/cpumask.h

2d3854a37e8b76 Rusty Russell 2008-11-05 605
cd83e42c6b0413 Rusty Russell 2008-11-07 606 /**
cd83e42c6b0413 Rusty Russell 2008-11-07 607 * cpumask_of - the cpumask containing just a given cpu
cd83e42c6b0413 Rusty Russell 2008-11-07 608 * @cpu: the cpu (<= nr_cpu_ids)
cd83e42c6b0413 Rusty Russell 2008-11-07 609 */
cd83e42c6b0413 Rusty Russell 2008-11-07 @610 #define cpumask_of(cpu) (get_cpu_mask(cpu))
cd83e42c6b0413 Rusty Russell 2008-11-07 611

:::::: The code at line 610 was first introduced by commit
:::::: cd83e42c6b0413dcbb548c2ead799111ff7e6a13 cpumask: new API, v2

:::::: TO: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
:::::: CC: Ingo Molnar <mingo@xxxxxxx>

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

Attachment: .config.gz
Description: application/gzip