Re: [PATCH] rust: cpufreq: fix clippy::double_parens warning in Policy doctest
From: Gary Guo
Date: Wed Mar 04 2026 - 15:31:05 EST
On Wed Mar 4, 2026 at 7:53 PM GMT, John Hubbard wrote:
> Clippy reports:
> warning: consider removing unnecessary double parentheses
> --> rust/kernel/cpufreq.rs:410:60
> |
> 410 | pr_info!("The policy details are: {:?}\n", (policy.cpu(), policy.cur()));
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
This looks like a Clippy bug that's fixed in latest Clippy:
https://github.com/rust-lang/rust-clippy/pull/15939
Best,
Gary
> Fix this by using separate format arguments.
>
> Fixes: 6ebdd7c93177 ("rust: cpufreq: Extend abstractions for policy and driver ops")
> Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
> ---
> rust/kernel/cpufreq.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/rust/kernel/cpufreq.rs b/rust/kernel/cpufreq.rs
> index 76faa1ac8501..e94a17731557 100644
> --- a/rust/kernel/cpufreq.rs
> +++ b/rust/kernel/cpufreq.rs
> @@ -407,7 +407,7 @@ pub fn to_table(mut self) -> Result<TableBox> {
> /// .set_fast_switch_possible(true)
> /// .set_transition_latency_ns(DEFAULT_TRANSITION_LATENCY_NS);
> ///
> -/// pr_info!("The policy details are: {:?}\n", (policy.cpu(), policy.cur()));
> +/// pr_info!("The policy details are: cpu={:?}, cur={:?}\n", policy.cpu(), policy.cur());
> /// }
> /// ```
> #[repr(transparent)]
>
> base-commit: ecc64d2dc9ff9738d2a896beb68e02c2feaf9a02