Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: net::phy scope ThisModule usage in the module_phy_driver macro

Similar to the use of $crate::Module, ThisModule should be referred to as
$crate::ThisModule in the macro evaluation. The reason the macro previously
did not cause any errors is because all the users of the macro would use
kernel::prelude::*, bringing ThisModule into scope.

Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
Reviewed-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20241214194242.19505-1-sergeantsagara@protonmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Rahul Rameshbabu and committed by
Paolo Abeni
d22f955c ff9f17ce

+2 -2
+2 -2
rust/kernel/net/phy.rs
··· 837 837 /// [::kernel::net::phy::create_phy_driver::<PhySample>()]; 838 838 /// 839 839 /// impl ::kernel::Module for Module { 840 - /// fn init(module: &'static ThisModule) -> Result<Self> { 840 + /// fn init(module: &'static ::kernel::ThisModule) -> Result<Self> { 841 841 /// let drivers = unsafe { &mut DRIVERS }; 842 842 /// let mut reg = ::kernel::net::phy::Registration::register( 843 843 /// module, ··· 903 903 [$($crate::net::phy::create_phy_driver::<$driver>()),+]; 904 904 905 905 impl $crate::Module for Module { 906 - fn init(module: &'static ThisModule) -> Result<Self> { 906 + fn init(module: &'static $crate::ThisModule) -> Result<Self> { 907 907 // SAFETY: The anonymous constant guarantees that nobody else can access 908 908 // the `DRIVERS` static. The array is used only in the C side. 909 909 let drivers = unsafe { &mut DRIVERS };