From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4505C641 for ; Fri, 17 Mar 2023 05:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679031481; x=1710567481; h=date:from:to:cc:subject:message-id:mime-version; bh=+nu4OAOLRUn+w/ukADDNy5yc0bWIYZINEmc0yezcMxA=; b=CsTTZX9alT2G2p9m99RvmBvpEEKYdiW6Ue4qF/DvXKgzl3uzm+O/kj0k G5PC/cAG8kES/nk/5kxeMHyfSdy/0j6oMh3jp5T8/qWNCQ8l8wormI83n WEU7D+6Zdewd7wbcsaulXjKzLuEJ5MTEgXxpu/wAOFoP2qbSpAqUkvvmL C67SNwj8PinItJry+UQ2AmY8yb7lNAdO2JN+U/ythZhkYjYOojkhM1qqU AC8pWcWvSUwpRsCZ1ujXQVGQ0is6ccnv0cQB7thRnBuuh6GXeWtYH9wxJ 6ZQvkj2ASchmaXbTpotjz7QC28st1+x01owEFN0U128qXiq8IkZJ/fjs0 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="339727104" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="339727104" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2023 22:38:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="749132843" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="749132843" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by fmsmga004.fm.intel.com with ESMTP; 16 Mar 2023 22:37:58 -0700 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1pd2ms-00098g-0K; Fri, 17 Mar 2023 05:37:58 +0000 Date: Fri, 17 Mar 2023 13:37:53 +0800 From: kernel test robot To: Viktor Malik Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Alexei Starovoitov , Luis Chamberlain Subject: [linux-next:master 3949/4413] include/linux/container_of.h:20:54: error: invalid use of undefined type 'struct module' Message-ID: <202303171300.g6uEM0X9-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 | 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 :::::: CC: Linus Torvalds -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests