Skip to content

Commit e05d9e5

Browse files
tamirdvireshk
authored andcommitted
rust: cpufreq: replace kernel::c_str! with C-Strings
C-String literals were added in Rust 1.77. Replace instances of `kernel::c_str!` with C-String literals where possible. 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> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent d6a6c58 commit e05d9e5

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/cpufreq/rcpufreq_dt.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! Rust based implementation of the cpufreq-dt driver.
44
55
use kernel::{
6-
c_str,
76
clk::Clk,
87
cpu, cpufreq,
98
cpumask::CpumaskVar,
@@ -52,7 +51,7 @@ impl opp::ConfigOps for CPUFreqDTDriver {}
5251

5352
#[vtable]
5453
impl cpufreq::Driver for CPUFreqDTDriver {
55-
const NAME: &'static CStr = c_str!("cpufreq-dt");
54+
const NAME: &'static CStr = c"cpufreq-dt";
5655
const FLAGS: u16 = cpufreq::flags::NEED_INITIAL_FREQ_CHECK | cpufreq::flags::IS_COOLING_DEV;
5756
const BOOST_ENABLED: bool = true;
5857

@@ -197,7 +196,7 @@ kernel::of_device_table!(
197196
OF_TABLE,
198197
MODULE_OF_TABLE,
199198
<CPUFreqDTDriver as platform::Driver>::IdInfo,
200-
[(of::DeviceId::new(c_str!("operating-points-v2")), ())]
199+
[(of::DeviceId::new(c"operating-points-v2"), ())]
201200
);
202201

203202
impl platform::Driver for CPUFreqDTDriver {

rust/kernel/cpufreq.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ pub trait Driver {
840840
/// ```
841841
/// use kernel::{
842842
/// cpufreq,
843-
/// c_str,
844843
/// device::{Core, Device},
845844
/// macros::vtable,
846845
/// of, platform,
@@ -853,7 +852,7 @@ pub trait Driver {
853852
///
854853
/// #[vtable]
855854
/// impl cpufreq::Driver for SampleDriver {
856-
/// const NAME: &'static CStr = c_str!("cpufreq-sample");
855+
/// const NAME: &'static CStr = c"cpufreq-sample";
857856
/// const FLAGS: u16 = cpufreq::flags::NEED_INITIAL_FREQ_CHECK | cpufreq::flags::IS_COOLING_DEV;
858857
/// const BOOST_ENABLED: bool = true;
859858
///

0 commit comments

Comments
 (0)