Thread (32 messages) 32 messages, 8 authors, 2025-06-22

Re: [PATCH v12 1/6] rust: enable `clippy::ptr_as_ptr` lint

From: Miguel Ojeda <hidden>
Date: 2025-06-18 16:48:21
Also in: dri-devel, linux-block, linux-devicetree, linux-kbuild, linux-kselftest, linux-mm, linux-pci, linux-pm, lkml, nouveau, rust-for-linux
Subsystem: operating performance points (opp), rust, the rest · Maintainers: Viresh Kumar, Nishanth Menon, Stephen Boyd, Miguel Ojeda, Linus Torvalds

On Sun, Jun 15, 2025 at 10:55 PM Tamir Duberstein [off-list ref] wrote:
Apply these changes and enable the lint -- no functional change
intended.
We need one more for `opp` [1] -- Viresh: I can do it on apply, unless
you disagree.

Cheers,
Miguel

[1]
diff --git a/rust/kernel/opp.rs b/rust/kernel/opp.rs
index a566fc3e7dcb..bc82a85ca883 100644
--- a/rust/kernel/opp.rs
+++ b/rust/kernel/opp.rs
@@ -92,7 +92,7 @@ fn to_c_str_array(names: &[CString]) ->
Result<KVec<*const u8>> {
     let mut list = KVec::with_capacity(names.len() + 1, GFP_KERNEL)?;

     for name in names.iter() {
-        list.push(name.as_ptr() as _, GFP_KERNEL)?;
+        list.push(name.as_ptr().cast(), GFP_KERNEL)?;
     }

     list.push(ptr::null(), GFP_KERNEL)?;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help