]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: configfs: use `CStr::as_char_ptr`
authorTamir Duberstein <tamird@gmail.com>
Sat, 18 Oct 2025 19:16:33 +0000 (15:16 -0400)
committerMiguel Ojeda <ojeda@kernel.org>
Wed, 22 Oct 2025 05:14:57 +0000 (07:14 +0200)
Replace the use of `as_ptr` which works through `<CStr as
Deref<Target=&[u8]>::deref()` in preparation for replacing
`kernel::str::CStr` with `core::ffi::CStr` as the latter does not
implement `Deref<Target=&[u8]>`.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://patch.msgid.link/20251018-cstr-core-v18-12-9378a54385f8@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/configfs.rs

index 10f1547ca9f199b8f8b9444adc031d2c5470d8fb..466fb7f407628b3b789bfb7d5f7538a9c96cf353 100644 (file)
@@ -157,7 +157,7 @@ impl<Data> Subsystem<Data> {
                     unsafe {
                         bindings::config_group_init_type_name(
                             &mut (*place.get()).su_group,
-                            name.as_ptr(),
+                            name.as_char_ptr(),
                             item_type.as_ptr(),
                         )
                     };