From nobody Sat Nov 23 11:01:38 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A25E467A0D for ; Thu, 21 Nov 2024 02:12:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732155140; cv=none; b=Q4vCy5tFZI+IxIeaCXK8DnaBoOT4h+S55ECvYENL1sRwBI/1HEeqITZP1Z/Np+HBx/Oeiy5ly+cEZajW6Ujtjcta0z2rcitWKWwRkSIFc+gXGTKX1lJNJoogJiH7WOMdbQNFZ5EWnLpPOpqCV5tPzzYL3ZCNg8tMVviv4NgcYuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732155140; c=relaxed/simple; bh=jKh9nRPLGScJAFprkK5YSEkVNnzGAg7RF1vxzoTG+BU=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=bz4RzJ3JkUynD8Ljt8rbLFgBU4I50ZOUk4yZP4SYID0YbFcofM8JrA0SrkeMYkLGDsx15HGCvrPbqf6mrkRwTqDhH7k6P295tOMCQXBypy4puSRuT1Ez1os8MTDKdhjR5ofy9fSqeH3sXDCdrFhVj4ICz5fhUay3eDvv3oH7JOo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F2F4C4CED6; Thu, 21 Nov 2024 02:12:20 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1tDwgj-00000002ZiK-29hx; Wed, 20 Nov 2024 21:12:57 -0500 Message-ID: <20241121021257.362820940@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 20 Nov 2024 21:12:28 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Miguel Ojeda Subject: [for-next][PATCH 2/2] rust: jump_label: skip formatting generated file References: <20241121021226.575757843@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Miguel Ojeda 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 fol= lowed 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 Cc: Alex Gaynor Cc: Mathieu Desnoyers Cc: Boqun Feng Cc: Gary Guo Cc: Bj=C3=B6rn Roy Baron Cc: Benno Lossin Cc: Andreas Hindborg Cc: Alice Ryhl Cc: Trevor Gross Link: https://lore.kernel.org/20241120175916.58860-1-ojeda@kernel.org Fixes: 169484ab6677 ("rust: add arch_static_branch") Signed-off-by: Miguel Ojeda Signed-off-by: Steven Rostedt (Google) --- rust/Makefile | 4 ++-- rust/kernel/.gitignore | 2 +- ..._branch_asm.rs.S =3D> generated_arch_static_branch_asm.rs.S} | 0 rust/kernel/jump_label.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename rust/kernel/{arch_static_branch_asm.rs.S =3D> generated_arch_static= _branch_asm.rs.S} (100%) diff --git a/rust/Makefile b/rust/Makefile index bc2a9071dd29..99db963637e6 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -36,7 +36,7 @@ always-$(CONFIG_RUST_KERNEL_DOCTESTS) +=3D doctests_kerne= l_generated_kunit.c obj-$(CONFIG_RUST_KERNEL_DOCTESTS) +=3D doctests_kernel_generated.o obj-$(CONFIG_RUST_KERNEL_DOCTESTS) +=3D doctests_kernel_generated_kunit.o =20 -always-$(subst y,$(CONFIG_RUST),$(CONFIG_JUMP_LABEL)) +=3D kernel/arch_sta= tic_branch_asm.rs +always-$(subst y,$(CONFIG_RUST),$(CONFIG_JUMP_LABEL)) +=3D kernel/generate= d_arch_static_branch_asm.rs =20 # Avoids running `$(RUSTC)` for the sysroot when it may not be available. ifdef CONFIG_RUST @@ -427,7 +427,7 @@ $(obj)/kernel.o: $(src)/kernel/lib.rs $(obj)/alloc.o $(= obj)/build_error.o \ +$(call if_changed_rule,rustc_library) =20 ifdef CONFIG_JUMP_LABEL -$(obj)/kernel.o: $(obj)/kernel/arch_static_branch_asm.rs +$(obj)/kernel.o: $(obj)/kernel/generated_arch_static_branch_asm.rs endif =20 endif # CONFIG_RUST 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 =20 -/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/generate= d_arch_static_branch_asm.rs.S similarity index 100% rename from rust/kernel/arch_static_branch_asm.rs.S rename to 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 @@ macro_rules! static_branch_unlikely { #[cfg(CONFIG_JUMP_LABEL)] const _: &str =3D include!(concat!( env!("OBJTREE"), - "/rust/kernel/arch_static_branch_asm.rs" + "/rust/kernel/generated_arch_static_branch_asm.rs" )); =20 #[macro_export] @@ -48,7 +48,7 @@ macro_rules! static_branch_unlikely { macro_rules! arch_static_branch { ($key:path, $keytyp:ty, $field:ident, $branch:expr) =3D> {'my_label: { $crate::asm!( - include!(concat!(env!("OBJTREE"), "/rust/kernel/arch_static_br= anch_asm.rs")); + include!(concat!(env!("OBJTREE"), "/rust/kernel/generated_arch= _static_branch_asm.rs")); l_yes =3D label { break 'my_label true; }, --=20 2.45.2