lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <E7DE7379-7F5A-437A-A518-FCF90824CDB0@collabora.com>
Date: Mon, 22 Dec 2025 11:33:43 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Tamir Duberstein <tamird@...nel.org>
Cc: Michael Turquette <mturquette@...libre.com>,
 Stephen Boyd <sboyd@...nel.org>,
 Miguel Ojeda <ojeda@...nel.org>,
 Boqun Feng <boqun.feng@...il.com>,
 Gary Guo <gary@...yguo.net>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>,
 Benno Lossin <lossin@...nel.org>,
 Andreas Hindborg <a.hindborg@...nel.org>,
 Alice Ryhl <aliceryhl@...gle.com>,
 Trevor Gross <tmgross@...ch.edu>,
 Danilo Krummrich <dakr@...nel.org>,
 linux-clk@...r.kernel.org,
 rust-for-linux@...r.kernel.org,
 linux-kernel@...r.kernel.org,
 Tamir Duberstein <tamird@...il.com>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Viresh Kumar <viresh.kumar@...aro.org>
Subject: Re: [PATCH] rust: clk: replace `kernel::c_str!` with C-Strings



> On 22 Dec 2025, at 09:16, Tamir Duberstein <tamird@...nel.org> wrote:
> 
> From: Tamir Duberstein <tamird@...il.com>
> 
> 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@...uxfoundation.org>
> Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
> Reviewed-by: Benno Lossin <lossin@...nel.org>
> Acked-by: Stephen Boyd <sboyd@...nel.org>
> Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
> Signed-off-by: Tamir Duberstein <tamird@...il.com>
> ---
> rust/kernel/clk.rs | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/rust/kernel/clk.rs b/rust/kernel/clk.rs
> index c1cfaeaa36a2..68a0c2f4e318 100644
> --- a/rust/kernel/clk.rs
> +++ b/rust/kernel/clk.rs
> @@ -104,13 +104,12 @@ mod common_clk {
>     /// The following example demonstrates how to obtain and configure a clock for a device.
>     ///
>     /// ```
> -    /// use kernel::c_str;
>     /// use kernel::clk::{Clk, Hertz};
>     /// use kernel::device::Device;
>     /// use kernel::error::Result;
>     ///
>     /// fn configure_clk(dev: &Device) -> Result {
> -    ///     let clk = Clk::get(dev, Some(c_str!("apb_clk")))?;
> +    ///     let clk = Clk::get(dev, Some(c"apb_clk"))?;
>     ///
>     ///     clk.prepare_enable()?;
>     ///
> @@ -272,13 +271,12 @@ fn drop(&mut self) {
>     /// device. The code functions correctly whether or not the clock is available.
>     ///
>     /// ```
> -    /// use kernel::c_str;
>     /// use kernel::clk::{OptionalClk, Hertz};
>     /// use kernel::device::Device;
>     /// use kernel::error::Result;
>     ///
>     /// fn configure_clk(dev: &Device) -> Result {
> -    ///     let clk = OptionalClk::get(dev, Some(c_str!("apb_clk")))?;
> +    ///     let clk = OptionalClk::get(dev, Some(c"apb_clk"))?;
>     ///
>     ///     clk.prepare_enable()?;
>     ///
> 
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251222-cstr-clk-122a1428b919
> 
> Best regards,
> --  
> Tamir Duberstein <tamird@...il.com>
> 
> 

Reviewed-by: Daniel Almeida <daniel.almeida@...labora.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ