Skip to content

Commit a703d74

Browse files
committed
rust: macros: module: Functionally revert commit 7044dcf
The reverts commit 7044dcf ("rust: macros: fix soundness issue in `module!` macro"). Restores old "*RFL import: macros::module params functionality & deps" functionality. Fixes: 7044dcf ("rust: macros: fix soundness issue in `module!` macro") Signed-off-by: Janne Grunau <j@jannau.net>
1 parent b812f58 commit a703d74

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

rust/macros/module.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,9 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
560560
}};
561561
562562
// Double nested modules, since then nobody can access the public items inside.
563-
mod __module_init {{
564-
mod __module_init {{
565-
use super::super::{type_};
563+
//mod __module_init {{
564+
// mod __module_init {{
565+
// use {type_};
566566
use kernel::init::PinInit;
567567
568568
/// The \"Rust loadable module\" mark.
@@ -666,7 +666,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
666666
unsafe fn __init() -> core::ffi::c_int {{
667667
let initer = <{type_} as kernel::InPlaceModule>::init(
668668
kernel::c_str!(\"{name}\"),
669-
&super::super::THIS_MODULE
669+
&THIS_MODULE
670670
);
671671
// SAFETY: No data race, since `__MOD` can only be accessed by this module
672672
// and there only `__init` and `__exit` access it. These functions are only
@@ -694,8 +694,8 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
694694
695695
{modinfo}
696696
{generated_array_types}
697-
}}
698-
}}
697+
// }}
698+
//}}
699699
",
700700
type_ = info.type_,
701701
name = info.name,

0 commit comments

Comments
 (0)