[PATCH v2 1/1] rust: cpufreq: suppress clippy::double_parens in Policy doctest

From: John Hubbard

Date: Thu Mar 12 2026 - 00:20:18 EST


The kernel fmt! proc macro wraps each format argument as &(arg). Passing
a tuple such as (a, b) produces &((a, b)) after expansion. Clippy flags
that as double_parens, but it is a false positive fixed in Clippy 1.92
(rust-lang/rust-clippy#15939).

Suppress the warning on the affected doctest function with a reason
attribute so it can be removed once the minimum toolchain moves
past 1.92.

Suggested-by: Gary Guo <gary@xxxxxxxxxxx>
Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
---
rust/kernel/cpufreq.rs | 1 +
1 file changed, 1 insertion(+)

diff --git a/rust/kernel/cpufreq.rs b/rust/kernel/cpufreq.rs
index 76faa1ac8501..52fe061fc85e 100644
--- a/rust/kernel/cpufreq.rs
+++ b/rust/kernel/cpufreq.rs
@@ -401,6 +401,7 @@ pub fn to_table(mut self) -> Result<TableBox> {
/// ```
/// use kernel::cpufreq::{DEFAULT_TRANSITION_LATENCY_NS, Policy};
///
+/// #[allow(clippy::double_parens, reason = "false positive before 1.92")]
/// fn update_policy(policy: &mut Policy) {
/// policy
/// .set_dvfs_possible_from_any_cpu(true)
--
2.53.0