From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E1BCC6FD1D for ; Fri, 17 Mar 2023 05:38:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4232B900003; Fri, 17 Mar 2023 01:38:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D241900002; Fri, 17 Mar 2023 01:38:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29B0C900003; Fri, 17 Mar 2023 01:38:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 189C7900002 for ; Fri, 17 Mar 2023 01:38:07 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2C192C163F for ; Fri, 17 Mar 2023 05:38:06 +0000 (UTC) X-FDA: 80577284172.09.24869E2 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf23.hostedemail.com (Postfix) with ESMTP id EAF2A140008 for ; Fri, 17 Mar 2023 05:38:02 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ND0xKIHC; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf23.hostedemail.com: domain of lkp@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679031483; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=P59JJ3jmhkHbKXykSWqTXVD4OQuKVXefWNNwA3l9biE=; b=e5ycYGkL47AcdHOb76gRWK7gKbfvw6km3is49j8e8ghur5y5Nsbqzpqv8zEfiH9Gsy0YR8 pQLDrPkNk72FsF0X3rwjiSKeCoeGNO1loGZPboDK+OvoxOVCb++3WcJbvcZTn5fqGA0Ard EkFWrctb3vMAi7JB+K2WiBnfnBV7WQI= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ND0xKIHC; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf23.hostedemail.com: domain of lkp@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679031483; a=rsa-sha256; cv=none; b=h9wAxUc41ihYowD52V8f0xTCzvDVAr5QN6wG6OXDK2KlW/XQBhjMT0bIzC9ZmYuzzxR+ZF 4vg8coVSu7yXao3DTQzNYCgSvCkpMkuWJ9wL6L2H26xuxVIffybpzZL9YwtzxLWyOyKWXs NluFcncPzi54DpaAHNZ4jiDJ+sha40c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679031483; x=1710567483; h=date:from:to:cc:subject:message-id:mime-version; bh=+nu4OAOLRUn+w/ukADDNy5yc0bWIYZINEmc0yezcMxA=; b=ND0xKIHCltX2peWyo9xJukR3AOUSEX8RCd4L7YfE7QGcJp3GZW7YFVOx nc+QRWO3CSQyTamyjFyHUvXyUt+fhN7LOh0MJR5clJ3o8+IcD1RxcSPu2 KRcGVOLgonHU9IRgFiImY3h6W6duWU36h0QhZcmRhBBlEZS4V8EXGqopL SryuPFvSetH2prroWT6LOQRqH3unFqOb8nccMRA9I4FuqtJUKDmAadeiB JI2IwlemqI1tIW+0g67Icu82Rd3d8t43Pl7yIB3MfPoxWwEkdxHazTo7b 6gKGPPoDjohdcVB6N1wuzJ31iy8Jh93FG3treVscSulo1EiQ6O1RzzF0o A==; X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="339727103" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="339727103" 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: EAF2A140008 X-Stat-Signature: 5asw6h5kyus468djhewq58ukn5dnsk15 X-HE-Tag: 1679031482-438292 X-HE-Meta: U2FsdGVkX1/M4G6ME1SaZsUg89fnnZosOHQjayc+o/JXNJ1+3yDl9V0phGQ/NbNZ8ibadyxW6W+c/htrU7tYc0hhgg5wk05n/65e9x3mvBzS14LuYIZQuQc4wHqJmtC+0pcxsxpJRM2oMOutbYrQUJGe6M4uLmHOOi18/x8CoZRZMmIWwlAGrDaTTVdb5Lka1tSXhpr7rPLnDVJPvihgOuBk+mnkBqKIpTzdzctt+SESpCwwdnZ7P3RX0jeNFMDCRp0+ArbdoZaAJkq8gYfFI88A+cLGJ1LY4QtAyJZvm98yiMKgzCLrSHW0nb7d2H+9d1JkK4/oVhy7TCdZ/fSp+xWtVLWu56LzPAGbCB8awunje05YPDsrkGA7THphqaxXk5F10I2LNE7zteCCumyGoElfKOnKNtlRN5zG7tIOEjvERWOQRwHABOJLH4r2eEXcXqAISY398XdN7v1eaVXWLYnocofMeYEKFK2O09LI31G7MQCIwNM2lewWYygPtNC5gEvO/nBR/fQ9hu94Z/rIFPQVRnJ717S3Wj8dAv39PQPDEKvCJTTEloja3kxKkL18n0hsrVzIF9APslJPjAt3mhU/NMCeZ02rGhMcgMkTcAd36EDE2lF3BwrcW6Lxq1NTkFLJ7a9VnNaHzC/5HQ/PrMrLkVuiA64LnStZYs8Y5Ofj2T6QYNaDM40VlHuyn2J2cKP93y1Qn7lrHdbQ92V1fpLWs2cV+o3QjxRDovAuE7RDyym41r2ZS41KSMO4ePIaNirqC9G6tmlx4UEAoigip4+6dWZxjNiaM2voqBXf5p3WqjaHfLRlgh+TOnuU0S72gNtS3Pjvs5sr2kFfNwi+dmMxo3uNodf8gB3AddS4PM915anaoPyH9KrDwtA7exedeBv3xSA5LN50hQSTqotvwYlTwQu8jwtNxDuc8exNq/O8byUPLZLo+Cbvd8JqFz0/WXMMaFfTJ1R3595rn+A QWjUvG5+ IX0ZIZVRxjPPDOj/XKMOYEor5S05JYlKxIHKnuEu/GzJ6BjNN8bWVKamohQ/SkpPBP8QZyVWtca0zWn8+xodyFzmUko1yRSBmdsMwEA7gnzutghit6w4wSZJtjfhjKervtEfBIycVVPga1zJJTbuFbIfcTJZlAvQY9COXc+dq8KuuqpnBSZ/V3RYwYDkJ+Sqbhns43NmckVylQj6lhn8Vr+DtuVQGDG3NwHnqfnsCLEJItP33bk+n3WxpjXOd/is2Pyhl4pn3Ao3QRxErSdqYTq2lEIVDplQiedSHA/6+ProijXYeSVWn+SQbxsh61tD5LLdFujEAtuSltGu8w7TNmQBOBGhaIjyV4vBbvQ72FliecN860Xx05I0J31A4lj95+bYEDOZYGYnQD+OmglPVoVMofDNnxMzirt7q++uO5rHSAljq9FcpSB550E0qQwViRIJ3cr0dwWCUVSTRtqlm76g/NqckXSjvXR/i6GfsUS0QMhg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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