Skip to contentSkip to conversation

rust_binder: use `LocalModule` for `THIS_MODULE`

PATCH In review Gary Guo 3 participants 3 messages Aug 13 – Aug 14

Subsystems (3)
lore
Share & tools
lore

Gary Guo

author
#0 lore raw

PATCH 1/1 rust_binder: use `LocalModule` for `THIS_MODULE`

From: Gary Guo <[email protected]>

Replace the THIS_MODULE static reference in the binder netlink code with this_module::<LocalModule>(), consistent with the move of THIS_MODULE into the ModuleMetadata trait.

---
This is to resolve the semantic conflict between rust-next and char-misc-next.

---
 drivers/android/binder/netlink.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder/netlink.rs +1 -1
index beb7ea2edaff..f34e1009432c 100644
@@ -13,7 +13,7 @@
 };
 
 pub static BINDER_NL_FAMILY: Family = Family::const_new(
-    &crate::THIS_MODULE,
+    kernel::module::this_module::<crate::LocalModule>(),
     kernel::uapi::BINDER_FAMILY_NAME,
     kernel::uapi::BINDER_FAMILY_VERSION,
     &BINDER_NL_FAMILY_MCGRPS,

base-commit: 2697ef8943c9985c14708a6429e21812693857b2

Signature · 1 line
2.54.0
#1 lore raw
Quoted 7 lines · Gary Guo

From: Gary Guo <[email protected]>

Replace the THIS_MODULE static reference in the binder netlink code with this_module::<LocalModule>(), consistent with the move of THIS_MODULE into the ModuleMetadata trait.

Quoted 5 lines

---
This is to resolve the semantic conflict between rust-next and char-misc-next.

Thanks Gary!

Cheers,
Miguel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Gary Guo
Quoted 8 lines · Gary Guo

From: Gary Guo <[email protected]>

Replace the THIS_MODULE static reference in the binder netlink code with this_module::<LocalModule>(), consistent with the move of THIS_MODULE into the ModuleMetadata trait.

Quoted 22 lines

---
This is to resolve the semantic conflict between rust-next and char-misc-next.

---
  drivers/android/binder/netlink.rs | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder/netlink.rs +1 -1
index beb7ea2edaff..f34e1009432c 100644
@@ -13,7 +13,7 @@
  };
 
  pub static BINDER_NL_FAMILY: Family = Family::const_new(
-    &crate::THIS_MODULE,
+    kernel::module::this_module::<crate::LocalModule>(),
      kernel::uapi::BINDER_FAMILY_NAME,
      kernel::uapi::BINDER_FAMILY_VERSION,
      &BINDER_NL_FAMILY_MCGRPS,

base-commit: 2697ef8943c9985c14708a6429e21812693857b2