Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH 0/6] rust: binder: reduce `as` casts
@ 2026-05-22 17:12 Tamir Duberstein
  2026-05-22 17:12 ` [PATCH 1/6] rust: binder: use strict provenance APIs Tamir Duberstein
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Tamir Duberstein @ 2026-05-22 17:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Christian Brauner, Carlos Llamas, Alice Ryhl, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross, Danilo Krummrich
  Cc: linux-kernel, rust-for-linux, Tamir Duberstein

Follow up on the treewide Clippy lint series [1]. The Rust Binder
driver retains local allows for `clippy::ptr_as_ptr`,
`clippy::ref_as_ptr`, `clippy::as_underscore`, and
`clippy::cast_lossless` even though those lints are enabled for the
rest of the kernel.

Fix the Binder violations and remove those allows one lint at a time.
The first two patches reduce related `as` casts outside those lint
enablements: use the strict provenance APIs for Binder
pointer-to-integer conversions now that they are available at the Rust
MSRV, and transmute embedded transaction data directly instead of
round-tripping a reference through raw pointer casts.

Link: https://lore.kernel.org/r/20250615-ptr-as-ptr-v12-0-f43b024581e8@gmail.com [1]
Signed-off-by: Tamir Duberstein <tamird@kernel.org>
---
Tamir Duberstein (6):
      rust: binder: use strict provenance APIs
      rust: binder: transmute transaction data
      rust: binder: enable `clippy::ptr_as_ptr` lint
      rust: binder: enable `clippy::ref_as_ptr` lint
      rust: binder: enable `clippy::as_underscore`
      rust: binder: enable `clippy::cast_lossless`

 drivers/android/binder/allocation.rs       |  4 ++--
 drivers/android/binder/defs.rs             |  7 ++-----
 drivers/android/binder/freeze.rs           |  2 +-
 drivers/android/binder/node.rs             | 12 ++++++------
 drivers/android/binder/node/wrapper.rs     |  2 +-
 drivers/android/binder/page_range.rs       |  8 ++++----
 drivers/android/binder/process.rs          | 12 ++++++------
 drivers/android/binder/rust_binder_main.rs | 10 ++--------
 drivers/android/binder/thread.rs           | 24 +++++++++++++-----------
 drivers/android/binder/trace.rs            |  2 +-
 drivers/android/binder/transaction.rs      | 12 ++++++------
 11 files changed, 44 insertions(+), 51 deletions(-)
---
base-commit: 5d6919055dec134de3c40167a490f33c74c12581
change-id: 20260522-binder-strict-provenance-077c5eddc943

Best regards,
--  
Tamir Duberstein <tamird@kernel.org>


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-05-26 13:42 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 17:12 [PATCH 0/6] rust: binder: reduce `as` casts Tamir Duberstein
2026-05-22 17:12 ` [PATCH 1/6] rust: binder: use strict provenance APIs Tamir Duberstein
2026-05-26 12:32   ` Alice Ryhl
2026-05-22 17:12 ` [PATCH 2/6] rust: binder: transmute transaction data Tamir Duberstein
2026-05-26 12:33   ` Alice Ryhl
2026-05-26 13:33     ` Tamir Duberstein
2026-05-26 13:36       ` Alice Ryhl
2026-05-26 13:39         ` Tamir Duberstein
2026-05-26 13:42           ` Alice Ryhl
2026-05-22 17:12 ` [PATCH 3/6] rust: binder: enable `clippy::ptr_as_ptr` lint Tamir Duberstein
2026-05-26 12:34   ` Alice Ryhl
2026-05-22 17:12 ` [PATCH 4/6] rust: binder: enable `clippy::ref_as_ptr` lint Tamir Duberstein
2026-05-26 12:46   ` Alice Ryhl
2026-05-26 13:37     ` Tamir Duberstein
2026-05-22 17:12 ` [PATCH 5/6] rust: binder: enable `clippy::as_underscore` Tamir Duberstein
2026-05-26 12:44   ` Alice Ryhl
2026-05-22 17:12 ` [PATCH 6/6] rust: binder: enable `clippy::cast_lossless` Tamir Duberstein
2026-05-26 12:44   ` Alice Ryhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox