* [linux-next:master 3949/4413] include/linux/container_of.h:20:54: error: invalid use of undefined type 'struct module'
@ 2023-03-17 5:37 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-17 5:37 UTC (permalink / raw)
To: Viktor Malik
Cc: oe-kbuild-all, Linux Memory Management List, Alexei Starovoitov,
Luis Chamberlain
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6f08c1de13a9403341c18b66638a05588b2663ce
commit: 31bf1dbccfb0a9861d4846755096b3fff5687f8a [3949/4413] bpf: Fix attaching fentry/fexit/fmod_ret/lsm to modules
config: s390-randconfig-r044-20230312 (https://download.01.org/0day-ci/archive/20230317/202303171300.g6uEM0X9-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.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/next/linux-next.git/commit/?id=31bf1dbccfb0a9861d4846755096b3fff5687f8a
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 31bf1dbccfb0a9861d4846755096b3fff5687f8a
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash kernel/bpf/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303171300.g6uEM0X9-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/timer.h:5,
from include/linux/workqueue.h:9,
from include/linux/bpf.h:10,
from include/linux/bpf-cgroup.h:5,
from kernel/bpf/verifier.c:7:
kernel/bpf/../module/internal.h: In function 'mod_find':
>> include/linux/container_of.h:20:54: error: invalid use of undefined type 'struct module'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/linux/rculist.h:391:20: note: in expansion of macro 'list_entry_rcu'
391 | pos = list_entry_rcu((head)->next, typeof(*pos), member); \
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/compiler_types.h:340:27: error: expression in static assertion is not an integer
340 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/linux/rculist.h:391:20: note: in expansion of macro 'list_entry_rcu'
391 | pos = list_entry_rcu((head)->next, typeof(*pos), member); \
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/uapi/linux/btf.h:6,
from kernel/bpf/verifier.c:6:
>> include/linux/stddef.h:16:33: error: invalid use of undefined type 'struct module'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^~~~~~~~~~~~~~~~~~
include/linux/container_of.h:23:28: note: in expansion of macro 'offsetof'
23 | ((type *)(__mptr - offsetof(type, member))); })
| ^~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/linux/rculist.h:391:20: note: in expansion of macro 'list_entry_rcu'
391 | pos = list_entry_rcu((head)->next, typeof(*pos), member); \
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/dcache.h:8,
from include/linux/fs.h:8,
from include/linux/compat.h:17,
from arch/s390/include/asm/elf.h:160,
from include/linux/elf.h:6,
from include/linux/module.h:19,
from include/linux/bpf.h:20:
>> include/linux/rculist.h:392:21: error: invalid use of undefined type 'struct module'
392 | &pos->member != (head); \
| ^~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/container_of.h:19:33: note: in definition of macro 'container_of'
19 | void *__mptr = (void *)(ptr); \
| ^~~
include/linux/compiler_types.h:387:9: note: in expansion of macro '__compiletime_assert'
387 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:399:9: note: in expansion of macro '_compiletime_assert'
399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:307:22: note: in expansion of macro 'READ_ONCE'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/container_of.h:19:33: note: in definition of macro 'container_of'
19 | void *__mptr = (void *)(ptr); \
| ^~~
include/linux/compiler_types.h:387:9: note: in expansion of macro '__compiletime_assert'
387 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:399:9: note: in expansion of macro '_compiletime_assert'
399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:307:22: note: in expansion of macro 'READ_ONCE'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/container_of.h:19:33: note: in definition of macro 'container_of'
19 | void *__mptr = (void *)(ptr); \
| ^~~
include/linux/compiler_types.h:387:9: note: in expansion of macro '__compiletime_assert'
387 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:399:9: note: in expansion of macro '_compiletime_assert'
399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:307:22: note: in expansion of macro 'READ_ONCE'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/container_of.h:19:33: note: in definition of macro 'container_of'
19 | void *__mptr = (void *)(ptr); \
--
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/linux/compiler_types.h:387:9: note: in expansion of macro '__compiletime_assert'
387 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:399:9: note: in expansion of macro '_compiletime_assert'
399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:307:22: note: in expansion of macro 'READ_ONCE'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/asm-generic/rwonce.h:44:43: note: in expansion of macro '__unqual_scalar_typeof'
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
include/linux/rculist.h:307:22: note: in expansion of macro 'READ_ONCE'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
include/linux/rculist.h:307:22: note: in expansion of macro 'READ_ONCE'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/container_of.h:20:54: error: invalid use of undefined type 'struct module'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:21:23: note: in expansion of macro '__same_type'
21 | __same_type(*(ptr), void), \
| ^~~~~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/linux/compiler_types.h:387:9: note: in expansion of macro '__compiletime_assert'
387 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:399:9: note: in expansion of macro '_compiletime_assert'
399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:307:22: note: in expansion of macro 'READ_ONCE'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:21:23: note: in expansion of macro '__same_type'
21 | __same_type(*(ptr), void), \
| ^~~~~~~~~~~
include/linux/rculist.h:307:9: note: in expansion of macro 'container_of'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~~~~
include/linux/compiler_types.h:387:9: note: in expansion of macro '__compiletime_assert'
387 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:399:9: note: in expansion of macro '_compiletime_assert'
399 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:307:22: note: in expansion of macro 'READ_ONCE'
307 | container_of(READ_ONCE(ptr), type, member)
| ^~~~~~~~~
include/linux/rculist.h:393:23: note: in expansion of macro 'list_entry_rcu'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
| ^~~~~~~~~~~~~~
kernel/bpf/../module/internal.h:212:9: note: in expansion of macro 'list_for_each_entry_rcu'
212 | list_for_each_entry_rcu(mod, &modules, list,
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:393:41: error: invalid use of undefined type 'struct module'
393 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
..
vim +20 include/linux/container_of.h
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 9
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 10 /**
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 11 * container_of - cast a member of a structure out to the containing structure
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 12 * @ptr: the pointer to the member.
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 13 * @type: the type of the container struct this is embedded in.
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 14 * @member: the name of the member within the struct.
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 15 *
7376e561fd2e01 Sakari Ailus 2022-10-24 16 * WARNING: any const qualifier of @ptr is lost.
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 17 */
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 18 #define container_of(ptr, type, member) ({ \
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 19 void *__mptr = (void *)(ptr); \
e1edc277e6f6df Rasmus Villemoes 2021-11-08 @20 static_assert(__same_type(*(ptr), ((type *)0)->member) || \
e1edc277e6f6df Rasmus Villemoes 2021-11-08 21 __same_type(*(ptr), void), \
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 22 "pointer type mismatch in container_of()"); \
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 23 ((type *)(__mptr - offsetof(type, member))); })
d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 24
:::::: The code at line 20 was first introduced by commit
:::::: e1edc277e6f6dfb372216522dfc57f9381c39e35 linux/container_of.h: switch to static_assert
:::::: TO: Rasmus Villemoes <linux@rasmusvillemoes.dk>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-17 5:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17 5:37 [linux-next:master 3949/4413] include/linux/container_of.h:20:54: error: invalid use of undefined type 'struct module' kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).