@@ -215,24 +215,24 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
215
215
// SAFETY: `__this_module` is constructed by the kernel at load time and will not be
216
216
// freed until the module is unloaded.
217
217
#[cfg(MODULE)]
218
- static THIS_MODULE: kernel::ThisModule = unsafe {{
218
+ static THIS_MODULE: :: kernel::ThisModule = unsafe {{
219
219
extern \" C\" {{
220
- static __this_module: kernel::types::Opaque<kernel::bindings::module>;
220
+ static __this_module: :: kernel::types::Opaque<:: kernel::bindings::module>;
221
221
}}
222
222
223
- kernel::ThisModule::from_ptr(__this_module.get())
223
+ :: kernel::ThisModule::from_ptr(__this_module.get())
224
224
}};
225
225
#[cfg(not(MODULE))]
226
- static THIS_MODULE: kernel::ThisModule = unsafe {{
227
- kernel::ThisModule::from_ptr(core::ptr::null_mut())
226
+ static THIS_MODULE: :: kernel::ThisModule = unsafe {{
227
+ :: kernel::ThisModule::from_ptr(:: core::ptr::null_mut())
228
228
}};
229
229
230
230
/// The `LocalModule` type is the type of the module created by `module!`,
231
231
/// `module_pci_driver!`, `module_platform_driver!`, etc.
232
232
type LocalModule = {type_};
233
233
234
- impl kernel::ModuleMetadata for {type_} {{
235
- const NAME: &'static kernel::str::CStr = kernel::c_str!(\" {name}\" );
234
+ impl :: kernel::ModuleMetadata for {type_} {{
235
+ const NAME: &'static :: kernel::str::CStr = :: kernel::c_str!(\" {name}\" );
236
236
}}
237
237
238
238
// Double nested modules, since then nobody can access the public items inside.
@@ -250,8 +250,8 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
250
250
#[used]
251
251
static __IS_RUST_MODULE: () = ();
252
252
253
- static mut __MOD: core::mem::MaybeUninit<{type_}> =
254
- core::mem::MaybeUninit::uninit();
253
+ static mut __MOD: :: core::mem::MaybeUninit<{type_}> =
254
+ :: core::mem::MaybeUninit::uninit();
255
255
256
256
// Loadable modules need to export the `{{init,cleanup}}_module` identifiers.
257
257
/// # Safety
@@ -262,7 +262,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
262
262
#[doc(hidden)]
263
263
#[no_mangle]
264
264
#[link_section = \" .init.text\" ]
265
- pub unsafe extern \" C\" fn init_module() -> kernel::ffi::c_int {{
265
+ pub unsafe extern \" C\" fn init_module() -> :: kernel::ffi::c_int {{
266
266
// SAFETY: This function is inaccessible to the outside due to the double
267
267
// module wrapping it. It is called exactly once by the C side via its
268
268
// unique name.
@@ -302,11 +302,12 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
302
302
#[doc(hidden)]
303
303
#[link_section = \" {initcall_section}\" ]
304
304
#[used]
305
- pub static __{name}_initcall: extern \" C\" fn() -> kernel::ffi::c_int = __{name}_init;
305
+ pub static __{name}_initcall: extern \" C\" fn() -> ::kernel::ffi::c_int =
306
+ __{name}_init;
306
307
307
308
#[cfg(not(MODULE))]
308
309
#[cfg(CONFIG_HAVE_ARCH_PREL32_RELOCATIONS)]
309
- core::arch::global_asm!(
310
+ :: core::arch::global_asm!(
310
311
r#\" .section \" {initcall_section}\" , \" a\"
311
312
__{name}_initcall:
312
313
.long __{name}_init - .
@@ -317,7 +318,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
317
318
#[cfg(not(MODULE))]
318
319
#[doc(hidden)]
319
320
#[no_mangle]
320
- pub extern \" C\" fn __{name}_init() -> kernel::ffi::c_int {{
321
+ pub extern \" C\" fn __{name}_init() -> :: kernel::ffi::c_int {{
321
322
// SAFETY: This function is inaccessible to the outside due to the double
322
323
// module wrapping it. It is called exactly once by the C side via its
323
324
// placement above in the initcall section.
@@ -340,9 +341,9 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
340
341
/// # Safety
341
342
///
342
343
/// This function must only be called once.
343
- unsafe fn __init() -> kernel::ffi::c_int {{
344
+ unsafe fn __init() -> :: kernel::ffi::c_int {{
344
345
let initer =
345
- <{type_} as kernel::InPlaceModule>::init(&super::super::THIS_MODULE);
346
+ <{type_} as :: kernel::InPlaceModule>::init(&super::super::THIS_MODULE);
346
347
// SAFETY: No data race, since `__MOD` can only be accessed by this module
347
348
// and there only `__init` and `__exit` access it. These functions are only
348
349
// called once and `__exit` cannot be called before or during `__init`.
0 commit comments