summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2025-08-13 11:41:55 -0400
committerMiguel Ojeda <ojeda@kernel.org>2025-09-16 09:26:59 +0200
commit23cd58b1d80364a0dbacf1f8ee5bf1b0aa825be1 (patch)
tree6b87dcf1ce50db58a7c4a62be684ee018ca15824 /rust/kernel
parenta3a7d09ab8bf881ea64aa8f33c76554ab9b5f6d6 (diff)
rust: cpufreq: use `core::ffi::CStr` method names
Prepare for `core::ffi::CStr` taking the place of `kernel::str::CStr` by avoid methods that only exist on the latter. Link: https://github.com/Rust-for-Linux/linux/issues/1075 Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Signed-off-by: Tamir Duberstein <tamird@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel')
-rw-r--r--rust/kernel/cpufreq.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/kernel/cpufreq.rs b/rust/kernel/cpufreq.rs
index be2dffbdb546..86c02e81729e 100644
--- a/rust/kernel/cpufreq.rs
+++ b/rust/kernel/cpufreq.rs
@@ -1016,7 +1016,7 @@ impl<T: Driver> Registration<T> {
};
const fn copy_name(name: &'static CStr) -> [c_char; CPUFREQ_NAME_LEN] {
- let src = name.as_bytes_with_nul();
+ let src = name.to_bytes_with_nul();
let mut dst = [0; CPUFREQ_NAME_LEN];
build_assert!(src.len() <= CPUFREQ_NAME_LEN);