Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48F7C4189B9 for ; Thu, 30 Jul 2026 11:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785412150; cv=none; b=OxkMXuC+xJRispZ5x4QIOQIpmYLD36A2hHJK0tP07AXL0cl7aTzkHgX6R5YGFZF9GpIQPlLynWl8nADlpzCRjnHg8ruEjeI5Qv/7VyM7VR1tQVsDmEvB7BVGXfUzP1xTYEh9JQkSR0monlhFJip7pvLe3xSuY5P9J+oCv5ecOtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785412150; c=relaxed/simple; bh=cLtGoydpOUFs4P84k117ZJ2hnnXup3ViobVHY8ugcpY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CjN/Dd+GAsijwMu+Amxk3uyxgKEbSX28G4TmrFyNdCgSVajZlcBX8W+H8/Gf23og/XeP3phS24lEne3QiWUHF3aoiEuhboL/jFJau05JY8vDnFjM54Haa0D/10IqckG8r8PyQdkPKNPJaUEOjIbQ5Xuc5WJ+QkJLF+hVS2XrPqs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jB0BEtUQ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jB0BEtUQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A6F11F000E9; Thu, 30 Jul 2026 11:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785412148; bh=WMaUBNEqMZT/2DaQoj3AycR7sm7+z5yY1rMpSWTxQ8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jB0BEtUQu7LYFzCppnH1kH/IOwv2/v8Hbxgv0gOsgJhpJODawdKAd9LGL3RrWgTz7 acZb1LHBr6pq0PJhtLn6X/wlmUaK0Zzy0E8/DqHQze5T7Eh9AwdjQfUXUSn6XpQqd8 4sCEfowBQK01NE2Gt54o1X/q523nX1v3ECbd3Mqe8zE+p7kyoSWMkBc2iSh6JBZasu zUg1XLVDdN3aumdVwlAO+npYn3pAWvzNowAKdnvfVjakWGnog3YwOdqwhiTfFxho1G 9ES2XexKzQv038qO7ajyecyYGHGHnTVwIYt0efbWkOB/HOIvN5YmkK8aFPmqmTE4pY SbCMFLKJ22MqQ== From: Miguel Ojeda To: stable@vger.kernel.org Cc: Alice Ryhl , Gary Guo , Danilo Krummrich , Miguel Ojeda Subject: [PATCH 6.18.y] rust: device: avoid trailing ; in printing macros Date: Thu, 30 Jul 2026 13:48:53 +0200 Message-ID: <20260730114853.70398-1-ojeda@kernel.org> In-Reply-To: <2026072907-spearhead-karma-9b2b@gregkh> References: <2026072907-spearhead-karma-9b2b@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alice Ryhl These macros are used like expressions, so they should not emit a semicolon. This is being turned into a hard error in a future release of Rust. error: trailing semicolon in macro used in expression position --> drivers/gpu/nova-core/firmware/fsp.rs:79:34 | 79 | .inspect_err(|_| dev_err!(dev, "FMC firmware missing '{}' section\n", name)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #79813 = note: this error originates in the macro `dev_err` (in Nightly builds, run with -Z macro-backtrace for more info) [ I was doubly surprised since upstream made it a deny-by-default lint a year ago for Rust 1.91.0, and yet we didn't see it; plus I hadn't seen this in my CI even yesterday. It turns out this just landed into today's nightly (nightly-2026-07-16, using upstream commit d0babd8b6): Link: https://github.com/rust-lang/rust/pull/159222 which says: "The `semicolon_in_expressions_from_macros` lint previously suppressed warnings about non-local macros. This masks a lint that will subsequently become a hard error." So that explains it. And this is the PR that will make it a hard error at some point in the future: Link: https://github.com/rust-lang/rust/pull/159218 Thus starting with Rust 1.99.0 (expected 2026-10-01), we will be seeing the deny-by-default lint above, so clean it up already. - Miguel ] Cc: stable@vger.kernel.org # Needed in 6.18.y and later. Link: https://github.com/rust-lang/rust/issues/79813 Signed-off-by: Alice Ryhl Reviewed-by: Gary Guo Acked-by: Danilo Krummrich Link: https://github.com/rust-lang/rust/pull/159218 Link: https://github.com/rust-lang/rust/pull/159222 Link: https://patch.msgid.link/20260716-device-trail-semicolon-v1-1-f48e9dcfae15@google.com [ Fixed typo. ] Signed-off-by: Miguel Ojeda (cherry picked from commit a19bda861b3a79e25417462539df8b0d77c6b322) [ Resolved conflict on `dev_printk` by not performing a similar cleanup since it is not strictly needed. - Miguel ] Signed-off-by: Miguel Ojeda --- rust/kernel/device.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs index 176531f54ed3..a82b1bde1fa8 100644 --- a/rust/kernel/device.rs +++ b/rust/kernel/device.rs @@ -625,7 +625,7 @@ macro_rules! dev_printk { /// ``` #[macro_export] macro_rules! dev_emerg { - ($($f:tt)*) => { $crate::dev_printk!(pr_emerg, $($f)*); } + ($($f:tt)*) => { $crate::dev_printk!(pr_emerg, $($f)*) } } /// Prints an alert-level message (level 1) prefixed with device information. @@ -651,7 +651,7 @@ macro_rules! dev_emerg { /// ``` #[macro_export] macro_rules! dev_alert { - ($($f:tt)*) => { $crate::dev_printk!(pr_alert, $($f)*); } + ($($f:tt)*) => { $crate::dev_printk!(pr_alert, $($f)*) } } /// Prints a critical-level message (level 2) prefixed with device information. @@ -677,7 +677,7 @@ macro_rules! dev_alert { /// ``` #[macro_export] macro_rules! dev_crit { - ($($f:tt)*) => { $crate::dev_printk!(pr_crit, $($f)*); } + ($($f:tt)*) => { $crate::dev_printk!(pr_crit, $($f)*) } } /// Prints an error-level message (level 3) prefixed with device information. @@ -703,7 +703,7 @@ macro_rules! dev_crit { /// ``` #[macro_export] macro_rules! dev_err { - ($($f:tt)*) => { $crate::dev_printk!(pr_err, $($f)*); } + ($($f:tt)*) => { $crate::dev_printk!(pr_err, $($f)*) } } /// Prints a warning-level message (level 4) prefixed with device information. @@ -729,7 +729,7 @@ macro_rules! dev_err { /// ``` #[macro_export] macro_rules! dev_warn { - ($($f:tt)*) => { $crate::dev_printk!(pr_warn, $($f)*); } + ($($f:tt)*) => { $crate::dev_printk!(pr_warn, $($f)*) } } /// Prints a notice-level message (level 5) prefixed with device information. @@ -755,7 +755,7 @@ macro_rules! dev_warn { /// ``` #[macro_export] macro_rules! dev_notice { - ($($f:tt)*) => { $crate::dev_printk!(pr_notice, $($f)*); } + ($($f:tt)*) => { $crate::dev_printk!(pr_notice, $($f)*) } } /// Prints an info-level message (level 6) prefixed with device information. @@ -781,7 +781,7 @@ macro_rules! dev_notice { /// ``` #[macro_export] macro_rules! dev_info { - ($($f:tt)*) => { $crate::dev_printk!(pr_info, $($f)*); } + ($($f:tt)*) => { $crate::dev_printk!(pr_info, $($f)*) } } /// Prints a debug-level message (level 7) prefixed with device information. @@ -807,5 +807,5 @@ macro_rules! dev_info { /// ``` #[macro_export] macro_rules! dev_dbg { - ($($f:tt)*) => { $crate::dev_printk!(pr_dbg, $($f)*); } + ($($f:tt)*) => { $crate::dev_printk!(pr_dbg, $($f)*) } } -- 2.55.0