]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: regulator: use `CStr::as_char_ptr`
authorTamir Duberstein <tamird@gmail.com>
Sat, 18 Oct 2025 19:16:34 +0000 (15:16 -0400)
committerMiguel Ojeda <ojeda@kernel.org>
Wed, 22 Oct 2025 05:14:57 +0000 (07:14 +0200)
commit9ce084e579bf550ee92b1ecbadf1c29a76c1062c
tree8a8b77fa29107fb7440e1c71fa4c23a089fb4c8e
parent3b46f65355c9627efd2dd8180c96b006a44d30f8
rust: regulator: use `CStr::as_char_ptr`

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: Mark Brown <broonie@kernel.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://patch.msgid.link/20251018-cstr-core-v18-13-9378a54385f8@gmail.com
[ Move safety comment below to support older Clippy. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/regulator.rs