diff mbox series

x86/asm: add commas to BUILD_BUG_ON

Message ID f15631b7-8cbe-40f3-b1d1-ac240440b10e@suse.com (mailing list archive)
State New
Headers show
Series x86/asm: add commas to BUILD_BUG_ON | expand

Commit Message

Jan Beulich March 6, 2024, 7:34 a.m. UTC
In light of recent observations with how macros are handled by gas,
let's play by what we informally set for ourselves as a guideline: Use
commas to separate parameters/arguments.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper March 6, 2024, 10:26 a.m. UTC | #1
On 06/03/2024 7:34 am, Jan Beulich wrote:
> In light of recent observations with how macros are handled by gas,
> let's play by what we informally set for ourselves as a guideline: Use
> commas to separate parameters/arguments.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

However, there are some other examples wanting the same treatment.

alternative-asm.h:14:.macro altinstruction_entry orig repl feature
orig_len repl_len pad_len
asm-defns.h:32:.macro INDIRECT_BRANCH insn:req arg:req
asm_defns.h:284:.macro RESTORE_ALL adj=0 compat=0
spec_ctrl_asm.h:107:.macro DO_OVERWRITE_RSB tmp=rax xu

Preferably, fix all of these in one go.


As for observations about the other architectures, PPC uses commas
everywhere.  RISC-V has no .macro's.  ARM looks to be a 50/50 mix.
diff mbox series

Patch

--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -82,13 +82,13 @@  register unsigned long current_stack_poi
 
 #ifdef __ASSEMBLY__
 
-.macro BUILD_BUG_ON condstr cond:vararg
+.macro BUILD_BUG_ON condstr, cond:vararg
         .if \cond
         .error "Condition \"\condstr\" not satisfied"
         .endif
 .endm
 /* preprocessor macro to make error message more user friendly */
-#define BUILD_BUG_ON(cond) BUILD_BUG_ON #cond cond
+#define BUILD_BUG_ON(cond) BUILD_BUG_ON #cond, cond
 
 #ifdef HAVE_AS_QUOTED_SYM
 #define SUBSECTION_LBL(tag)                        \