[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iSnZkEOmmeVnLJ=f+EQB5Xsa8yZY5g-0kEZm+Rovdnag@mail.gmail.com>
Date: Tue, 27 May 2025 15:33:25 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>, Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rust: opp: Move `cfg(CONFIG_OF)` attribute to the top of
doc test
On Tue, May 27, 2025 at 7:33 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> Move the `#[cfg(CONFIG_OF)]` attribute to the top of the documentation test
> block and hide it. This applies the condition to the entire test and improves
> readability.
>
> Placing configuration flags like `CONFIG_OF` at the top serves as a clear
> indicator of the conditions under which the example is valid, effectively
> acting like configuration metadata for the example itself.
>
> Suggested-by: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
> Rafael,
>
> Sorry for the trouble, one more patch to apply :(
No problem, applied.
Thanks!
> rust/kernel/opp.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/rust/kernel/opp.rs b/rust/kernel/opp.rs
> index c2bdc11f3999..a566fc3e7dcb 100644
> --- a/rust/kernel/opp.rs
> +++ b/rust/kernel/opp.rs
> @@ -575,6 +575,7 @@ extern "C" fn config_regulators(
> /// frequency.
> ///
> /// ```
> +/// # #![cfg(CONFIG_OF)]
> /// use kernel::clk::Hertz;
> /// use kernel::cpumask::Cpumask;
> /// use kernel::device::Device;
> @@ -582,7 +583,6 @@ extern "C" fn config_regulators(
> /// use kernel::opp::Table;
> /// use kernel::types::ARef;
> ///
> -/// #[cfg(CONFIG_OF)]
> /// fn get_table(dev: &ARef<Device>, mask: &mut Cpumask, freq: Hertz) -> Result<Table> {
> /// let mut opp_table = Table::from_of_cpumask(dev, mask)?;
> ///
> --
> 2.31.1.272.g89b43f80a514
>
>
Powered by blists - more mailing lists