Re: [linux-next:master 6196/6545] error[E0425]: cannot find type `initcall_modname` in crate `::kernel::bindings`
flat view
From: Aaron Tomlin <atomlin@atomlin.com>
Date: 2026-09-25 17:07:07
Also in:
linux-mm, llvm, oe-kbuild-all
Subsystem:
the rest · Maintainer:
Linus Torvalds
On Sun, Sep 20, 2026 at 02:22:08PM +0800, kernel test robot wrote:
quoted hunk
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 3f2425f5b5bbbdd991ca9cdfd5502e68d8895998 commit: b83e83203582477b2ad0631e29e6fd88295cd9b1 [6196/6545] module: extend module_blacklist parameter to built-in modules config: x86_64-randconfig-1010-20260919 (https://download.01.org/0day-ci/archive/20260920/202609201402.NyS4lCWY-lkp@intel.com/config) compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211) rustc: rustc 1.96.0 (ac68faa20 2026-05-25) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260920/202609201402.NyS4lCWY-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot [off-list ref] | Closes: https://lore.kernel.org/oe-kbuild-all/202609201402.NyS4lCWY-lkp@intel.com/ (local) All errors (new ones prefixed by >>):quoted
quoted
error[E0425]: cannot find type `initcall_modname` in crate `::kernel::bindings`--> rust/doctests_kernel_generated.rs:7459:1 | 7459 | / module! { 7460 | | type: MyModule, 7461 | | name: "module_firmware_test", 7462 | | authors: ["Rust for Linux"], 7463 | | description: "module_firmware! test module", 7464 | | license: "GPL", 7465 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0422]: cannot find struct, variant or union type `initcall_modname` in crate `::kernel::bindings`--> rust/doctests_kernel_generated.rs:7459:1 | 7459 | / module! { 7460 | | type: MyModule, 7461 | | name: "module_firmware_test", 7462 | | authors: ["Rust for Linux"], 7463 | | description: "module_firmware! test module", 7464 | | license: "GPL", 7465 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0425]: cannot find type `initcall_modname` in crate `::kernel::bindings`--> rust/doctests_kernel_generated.rs:12639:1 | 12639 | / kernel::module_phy_driver! { 12640 | | drivers: [PhySample], 12641 | | device_table: [ 12642 | | DeviceId::new_with_driver::<PhySample>() ... | 12647 | | license: "GPL", 12648 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `$crate::prelude::module` which comes from the expansion of the macro `kernel::module_phy_driver` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0422]: cannot find struct, variant or union type `initcall_modname` in crate `::kernel::bindings`--> rust/doctests_kernel_generated.rs:12639:1 | 12639 | / kernel::module_phy_driver! { 12640 | | drivers: [PhySample], 12641 | | device_table: [ 12642 | | DeviceId::new_with_driver::<PhySample>() ... | 12647 | | license: "GPL", 12648 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `$crate::prelude::module` which comes from the expansion of the macro `kernel::module_phy_driver` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0425]: cannot find type `initcall_modname` in crate `::kernel::bindings`--> samples/rust/rust_driver_serdev.rs:82:1 | 82 | / kernel::module_serdev_device_driver! { 83 | | type: SampleDriver, 84 | | name: "rust_driver_serdev", 85 | | authors: ["Markus Probst"], 86 | | description: "Rust Serial device bus device driver", 87 | | license: "GPL v2", 88 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `$crate::prelude::module` which comes from the expansion of the macro `kernel::module_serdev_device_driver` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0422]: cannot find struct, variant or union type `initcall_modname` in crate `::kernel::bindings`--> samples/rust/rust_driver_serdev.rs:82:1 | 82 | / kernel::module_serdev_device_driver! { 83 | | type: SampleDriver, 84 | | name: "rust_driver_serdev", 85 | | authors: ["Markus Probst"], 86 | | description: "Rust Serial device bus device driver", 87 | | license: "GPL v2", 88 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `$crate::prelude::module` which comes from the expansion of the macro `kernel::module_serdev_device_driver` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0425]: cannot find type `initcall_modname` in crate `::kernel::bindings`--> samples/rust/rust_driver_faux.rs:11:1 | 11 | / module! { 12 | | type: SampleModule, 13 | | name: "rust_faux_driver", 14 | | authors: ["Lyude Paul"], 15 | | description: "Rust faux device sample", 16 | | license: "GPL", 17 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0422]: cannot find struct, variant or union type `initcall_modname` in crate `::kernel::bindings`--> samples/rust/rust_driver_faux.rs:11:1 | 11 | / module! { 12 | | type: SampleModule, 13 | | name: "rust_faux_driver", 14 | | authors: ["Lyude Paul"], 15 | | description: "Rust faux device sample", 16 | | license: "GPL", 17 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0425]: cannot find type `initcall_modname` in crate `::kernel::bindings`--> samples/rust/rust_debugfs_scoped.rs:24:1 | 24 | / module! { 25 | | type: RustScopedDebugFs, 26 | | name: "rust_debugfs_scoped", 27 | | authors: ["Matthew Maurer"], 28 | | description: "Rust Scoped DebugFS usage sample", 29 | | license: "GPL", 30 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0422]: cannot find struct, variant or union type `initcall_modname` in crate `::kernel::bindings`--> samples/rust/rust_debugfs_scoped.rs:24:1 | 24 | / module! { 25 | | type: RustScopedDebugFs, 26 | | name: "rust_debugfs_scoped", 27 | | authors: ["Matthew Maurer"], 28 | | description: "Rust Scoped DebugFS usage sample", 29 | | license: "GPL", 30 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info) --quoted
quoted
error[E0425]: cannot find type `initcall_modname` in crate `::kernel::bindings`--> samples/rust/rust_dma.rs:136:1 | 136 | / kernel::module_pci_driver! { 137 | | type: DmaSampleDriver, 138 | | name: "rust_dma", 139 | | authors: ["Abdiel Janulgue"], 140 | | description: "Rust DMA test", 141 | | license: "GPL v2", 142 | | } | |_^ not found in `::kernel::bindings` | = note: this error originates in the macro `$crate::prelude::module` which comes from the expansion of the macro `kernel::module_pci_driver` (in Nightly builds, run with -Z macro-backtrace for more info) .. -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Hi 0-Day, As indicated below initcall_modname is now defined immediately following exitcall_t under #ifndef __ASSEMBLY__ and outside #ifndef MODULE, ensuring bindgen (which runs with -DMODULE) generates the type into ::kernel::bindings.
diff --git a/include/linux/init.h b/include/linux/init.h
index 833b837ce11d..08cb8a294375 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h@@ -109,6 +109,11 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); +struct initcall_modname { + initcall_t initcall_fn; + const char *modname; +}; + #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS typedef int initcall_entry_t;
@@ -273,11 +278,6 @@ extern struct module __this_module; __initcall_name(initcall, __iid, id), \ __initcall_section(__sec, __iid)) -struct initcall_modname { - initcall_t initcall_fn; - const char *modname; -}; - #define ____define_initcall_modname(fn, id, __sec, __iid) \ __unique_initcall(fn, id, __sec, __iid) \ static const char __initstr_##fn[] __used __aligned(1) \
I will send another iteration. Kind regards, -- Aaron Tomlin