diff options
| author | Tamir Duberstein <tamird@kernel.org> | 2026-05-26 14:39:09 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-03 12:29:38 +0200 |
| commit | 36bddf13dc1b88616a2ecdb331ffc23c42a3eb67 (patch) | |
| tree | 653031fe88493aa4fc754cd2e2e8699514f3bdd4 /drivers/android/binder/node.rs | |
| parent | 7d7b2011e7554d481a6db9cf362a58508b3e009e (diff) | |
| download | linux-next-36bddf13dc1b88616a2ecdb331ffc23c42a3eb67.tar.gz linux-next-36bddf13dc1b88616a2ecdb331ffc23c42a3eb67.zip | |
rust: binder: enable `clippy::ref_as_ptr` lint
In Rust 1.78.0, Clippy introduced the `ref_as_ptr` lint [1]:
> Using `as` casts may result in silently changing mutability or type.
While this does not eliminate unchecked `as` conversions, it makes such
conversions easier to scrutinize. It also has the slight benefit of
removing a degree of freedom on which to bikeshed. Thus apply the
changes and enable the lint in the Binder Rust driver -- no functional
change intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr [1]
Assisted-by: Codex:gpt-5
Signed-off-by: Tamir Duberstein <tamird@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260526-binder-strict-provenance-v2-3-a41d89c29bc5@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder/node.rs')
| -rw-r--r-- | drivers/android/binder/node.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/android/binder/node.rs b/drivers/android/binder/node.rs index d710940c3c8f..3d96738dee66 100644 --- a/drivers/android/binder/node.rs +++ b/drivers/android/binder/node.rs @@ -21,6 +21,7 @@ use crate::{ }; use core::mem; +use core::ptr; mod wrapper; pub(crate) use self::wrapper::CritIncrWrapper; @@ -321,7 +322,7 @@ impl Node { /// An id that is unique across all binder nodes on the system. Used as the key in the /// `by_node` map. pub(crate) fn global_id(&self) -> usize { - (self as *const Node).addr() + ptr::from_ref(self).addr() } pub(crate) fn get_id(&self) -> (u64, u64) { |
