[rostedt-trace:ftrace/core 30/30] net/ipv4/netfilter/nf_nat_snmp_basic_main.c:218:2: error: used type 'typeof ((help))' (aka 'int (struct sk_buff *, unsigned int, struct nf_conn *, enum ip_conntrack_info)') where arithmetic or pointer type is required

From: kernel test robot
Date: Thu Oct 07 2021 - 12:00:30 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
head: 6a510d6844a63054e3f8b9a2c1fbbe3a62b13486
commit: 6a510d6844a63054e3f8b9a2c1fbbe3a62b13486 [30/30] rcu: Use typeof(p) instead of typeof(*p) *
config: x86_64-randconfig-a002-20211004 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 58b68e70ebf6308f982426a2618782f473218eed)
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/rostedt/linux-trace.git/commit/?id=6a510d6844a63054e3f8b9a2c1fbbe3a62b13486
git remote add rostedt-trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
git fetch --no-tags rostedt-trace ftrace/core
git checkout 6a510d6844a63054e3f8b9a2c1fbbe3a62b13486
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64

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

All errors (new ones prefixed by >>):

>> net/netfilter/nfnetlink_cttimeout.c:622:2: error: used type 'typeof ((ctnl_timeout_find_get))' (aka 'struct nf_ct_timeout *(struct net *, const char *)') where arithmetic or pointer type is required
RCU_INIT_POINTER(nf_ct_timeout_find_get_hook, ctnl_timeout_find_get);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:853:17: note: expanded from macro 'RCU_INIT_POINTER'
WRITE_ONCE(p, RCU_INITIALIZER(v)); \
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:411:28: note: expanded from macro 'RCU_INITIALIZER'
#define RCU_INITIALIZER(v) (typeof((v)) __force __rcu)(v)
^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
__WRITE_ONCE(x, val); \
~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
*(volatile typeof(x) *)&(x) = (val); \
^~~
>> net/netfilter/nfnetlink_cttimeout.c:623:2: error: used type 'typeof ((ctnl_timeout_put))' (aka 'void (struct nf_ct_timeout *)') where arithmetic or pointer type is required
RCU_INIT_POINTER(nf_ct_timeout_put_hook, ctnl_timeout_put);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:853:17: note: expanded from macro 'RCU_INIT_POINTER'
WRITE_ONCE(p, RCU_INITIALIZER(v)); \
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:411:28: note: expanded from macro 'RCU_INITIALIZER'
#define RCU_INITIALIZER(v) (typeof((v)) __force __rcu)(v)
^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
__WRITE_ONCE(x, val); \
~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
*(volatile typeof(x) *)&(x) = (val); \
^~~
2 errors generated.
--
>> net/ipv4/netfilter/nf_nat_snmp_basic_main.c:218:2: error: used type 'typeof ((help))' (aka 'int (struct sk_buff *, unsigned int, struct nf_conn *, enum ip_conntrack_info)') where arithmetic or pointer type is required
RCU_INIT_POINTER(nf_nat_snmp_hook, help);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:853:17: note: expanded from macro 'RCU_INIT_POINTER'
WRITE_ONCE(p, RCU_INITIALIZER(v)); \
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:411:28: note: expanded from macro 'RCU_INITIALIZER'
#define RCU_INITIALIZER(v) (typeof((v)) __force __rcu)(v)
^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
__WRITE_ONCE(x, val); \
~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
*(volatile typeof(x) *)&(x) = (val); \
^~~
1 error generated.


vim +218 net/ipv4/netfilter/nf_nat_snmp_basic_main.c

cc2d58634e0f48 Taehee Yoo 2018-01-08 214
cc2d58634e0f48 Taehee Yoo 2018-01-08 215 static int __init nf_nat_snmp_basic_init(void)
cc2d58634e0f48 Taehee Yoo 2018-01-08 216 {
cc2d58634e0f48 Taehee Yoo 2018-01-08 217 BUG_ON(nf_nat_snmp_hook != NULL);
cc2d58634e0f48 Taehee Yoo 2018-01-08 @218 RCU_INIT_POINTER(nf_nat_snmp_hook, help);
cc2d58634e0f48 Taehee Yoo 2018-01-08 219
cc2d58634e0f48 Taehee Yoo 2018-01-08 220 return nf_conntrack_helper_register(&snmp_trap_helper);
cc2d58634e0f48 Taehee Yoo 2018-01-08 221 }
cc2d58634e0f48 Taehee Yoo 2018-01-08 222

:::::: The code at line 218 was first introduced by commit
:::::: cc2d58634e0f489d28b5564c05abc69930b4d920 netfilter: nf_nat_snmp_basic: use asn1 decoder library

:::::: TO: Taehee Yoo <ap420073@xxxxxxxxx>
:::::: CC: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip