aboutsummaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorMiguel Ojeda <[email protected]>2024-11-20 18:59:16 +0100
committerSteven Rostedt (Google) <[email protected]>2024-11-20 13:32:42 -0500
commit8af7a50167833b6b22e30c008bbf95ab3ff1a5fb (patch)
tree1460b9069a338a4046d2b8e6954a4fbc0e2c84a6 /rust/kernel
parent7643155dce1428fd63e47d7afe8bf3dbca20cc25 (diff)
rust: jump_label: skip formatting generated file
After a source tree build of the kernel, and having used the `RSCPP` rule, running `rustfmt` fails with: error: macros that expand to items must be delimited with braces or followed by a semicolon --> rust/kernel/arch_static_branch_asm.rs:1:27 | 1 | ...ls!("1: jmp " ... ".popsection \n\t") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | help: change the delimiters to curly braces | 1 | ::kernel::concat_literals!{"1: jmp " ... ".popsection \n\t"} | ~ ~ help: add a semicolon | 1 | ::kernel::concat_literals!("1: jmp " ... ".popsection \n\t"); | + This file is not meant to be formatted nor works on its own since it is meant to be textually included. Thus skip formatting it by prefixing its name with `generated_`. Cc: Masami Hiramatsu <[email protected]> Cc: Alex Gaynor <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Boqun Feng <[email protected]> Cc: Gary Guo <[email protected]> Cc: Björn Roy Baron <[email protected]> Cc: Benno Lossin <[email protected]> Cc: Andreas Hindborg <[email protected]> Cc: Alice Ryhl <[email protected]> Cc: Trevor Gross <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: 169484ab6677 ("rust: add arch_static_branch") Signed-off-by: Miguel Ojeda <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'rust/kernel')
-rw-r--r--rust/kernel/.gitignore2
-rw-r--r--rust/kernel/generated_arch_static_branch_asm.rs.S (renamed from rust/kernel/arch_static_branch_asm.rs.S)0
-rw-r--r--rust/kernel/jump_label.rs4
3 files changed, 3 insertions, 3 deletions
diff --git a/rust/kernel/.gitignore b/rust/kernel/.gitignore
index d082731007c6..6ba39a178f30 100644
--- a/rust/kernel/.gitignore
+++ b/rust/kernel/.gitignore
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
-/arch_static_branch_asm.rs
+/generated_arch_static_branch_asm.rs
diff --git a/rust/kernel/arch_static_branch_asm.rs.S b/rust/kernel/generated_arch_static_branch_asm.rs.S
index 2afb638708db..2afb638708db 100644
--- a/rust/kernel/arch_static_branch_asm.rs.S
+++ b/rust/kernel/generated_arch_static_branch_asm.rs.S
diff --git a/rust/kernel/jump_label.rs b/rust/kernel/jump_label.rs
index b5aff632ecc7..4e974c768dbd 100644
--- a/rust/kernel/jump_label.rs
+++ b/rust/kernel/jump_label.rs
@@ -39,7 +39,7 @@ pub use static_branch_unlikely;
#[cfg(CONFIG_JUMP_LABEL)]
const _: &str = include!(concat!(
env!("OBJTREE"),
- "/rust/kernel/arch_static_branch_asm.rs"
+ "/rust/kernel/generated_arch_static_branch_asm.rs"
));
#[macro_export]
@@ -48,7 +48,7 @@ const _: &str = include!(concat!(
macro_rules! arch_static_branch {
($key:path, $keytyp:ty, $field:ident, $branch:expr) => {'my_label: {
$crate::asm!(
- include!(concat!(env!("OBJTREE"), "/rust/kernel/arch_static_branch_asm.rs"));
+ include!(concat!(env!("OBJTREE"), "/rust/kernel/generated_arch_static_branch_asm.rs"));
l_yes = label {
break 'my_label true;
},