diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-09-09 08:36:23 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-09-09 08:36:23 +0200 |
| commit | 895b4fae931a256f6c7c6c68f77a8e337980b5a1 (patch) | |
| tree | 4e01d0293b8caee875fb7938d26ba9e0a572b314 /rust/macros/module.rs | |
| parent | 72486eb13b254d0bee637a947f9ec46d01c37f04 (diff) | |
| parent | da3ea35007d0af457a0afc87e84fddaebc4e0b63 (diff) | |
Merge 6.11-rc7 into char-misc-next
We need the char-misc fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/macros/module.rs')
| -rw-r--r-- | rust/macros/module.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rust/macros/module.rs b/rust/macros/module.rs index 411dc103d82e..7a5b899e47b7 100644 --- a/rust/macros/module.rs +++ b/rust/macros/module.rs @@ -217,7 +217,11 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream { // freed until the module is unloaded. #[cfg(MODULE)] static THIS_MODULE: kernel::ThisModule = unsafe {{ - kernel::ThisModule::from_ptr(&kernel::bindings::__this_module as *const _ as *mut _) + extern \"C\" {{ + static __this_module: kernel::types::Opaque<kernel::bindings::module>; + }} + + kernel::ThisModule::from_ptr(__this_module.get()) }}; #[cfg(not(MODULE))] static THIS_MODULE: kernel::ThisModule = unsafe {{ |