All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] build: move double-$ into as-option-add
@ 2023-02-09 15:26 Jan Beulich
  2023-02-09 17:14 ` Anthony PERARD
  2023-02-09 17:16 ` Andrew Cooper
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2023-02-09 15:26 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini,
	Wei Liu, Anthony Perard, Roger Pau Monné

It's imo helping readability as well as uses a little if properly
arranging for sufficiently late macro expansion is part of the macro
itself, rather than all (applicable) instances of its users.

No functional change intended.

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

--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -13,8 +13,8 @@ CFLAGS += -msoft-float
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_AS_VMX)
-$(call as-option-add,CFLAGS,CC,"crc32 %eax$$(comma)%eax",-DHAVE_AS_SSE4_2)
-$(call as-option-add,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_AS_EPT)
+$(call as-option-add,CFLAGS,CC,"crc32 %eax$(comma)%eax",-DHAVE_AS_SSE4_2)
+$(call as-option-add,CFLAGS,CC,"invept (%rax)$(comma)%rax",-DHAVE_AS_EPT)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
 $(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
@@ -21,10 +21,10 @@ $(call as-option-add,CFLAGS,CC,"rdseed %
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,"clac",-DHAVE_AS_CLAC_STAC)
 $(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
-$(call as-option-add,CFLAGS,CC,".equ \"x\"$$(comma)1",-DHAVE_AS_QUOTED_SYM)
-$(call as-option-add,CFLAGS,CC,"invpcid (%rax)$$(comma)%rax",-DHAVE_AS_INVPCID)
-$(call as-option-add,CFLAGS,CC,"movdiri %rax$$(comma)(%rax)",-DHAVE_AS_MOVDIR)
-$(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$$(comma)%rax",-DHAVE_AS_ENQCMD)
+$(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
+$(call as-option-add,CFLAGS,CC,"invpcid (%rax)$(comma)%rax",-DHAVE_AS_INVPCID)
+$(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
+$(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
 
 # GAS's idea of true is -1.  Clang's idea is 1
 $(call as-option-add,CFLAGS,CC,\
@@ -32,7 +32,7 @@ $(call as-option-add,CFLAGS,CC,\
 
 # Check to see whether the assmbler supports the .nop directive.
 $(call as-option-add,CFLAGS,CC,\
-    ".L1: .L2: .nops (.L2 - .L1)$$(comma)9",-DHAVE_AS_NOPS_DIRECTIVE)
+    ".L1: .L2: .nops (.L2 - .L1)$(comma)9",-DHAVE_AS_NOPS_DIRECTIVE)
 
 CFLAGS += -mno-red-zone -fpic
 
--- a/xen/scripts/Kbuild.include
+++ b/xen/scripts/Kbuild.include
@@ -66,7 +66,7 @@ as-insn = $(if $(shell echo 'void _(void
 # Usage: $(call as-option-add,CFLAGS,CC,"insn",option-yes,option-no)
 as-option-add = $(eval $(call as-option-add-closure,$(1),$(2),$(3),$(4),$(5)))
 define as-option-add-closure
-    ifeq ($$(call as-insn,$$($(2)) $$($(1)),$(3),y,n),y)
+    ifeq ($$(call as-insn,$$($(2)) $$($(1)),$$(3),y,n),y)
         $(1) += $(4)
     else
         $(1) += $(5)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] build: move double-$ into as-option-add
  2023-02-09 15:26 [PATCH] build: move double-$ into as-option-add Jan Beulich
@ 2023-02-09 17:14 ` Anthony PERARD
  2023-02-09 17:16 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony PERARD @ 2023-02-09 17:14 UTC (permalink / raw)
  To: Jan Beulich
  Cc: xen-devel, Andrew Cooper, George Dunlap, Julien Grall,
	Stefano Stabellini, Wei Liu, Roger Pau Monné

On Thu, Feb 09, 2023 at 04:26:45PM +0100, Jan Beulich wrote:
> It's imo helping readability as well as uses a little if properly
> arranging for sufficiently late macro expansion is part of the macro
> itself, rather than all (applicable) instances of its users.
> 
> No functional change intended.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

I agree, that's much better.

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] build: move double-$ into as-option-add
  2023-02-09 15:26 [PATCH] build: move double-$ into as-option-add Jan Beulich
  2023-02-09 17:14 ` Anthony PERARD
@ 2023-02-09 17:16 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2023-02-09 17:16 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu,
	Anthony Perard, Roger Pau Monné

On 09/02/2023 3:26 pm, Jan Beulich wrote:
> It's imo helping readability as well as uses a little if properly
> arranging for sufficiently late macro expansion is part of the macro
> itself, rather than all (applicable) instances of its users.
>
> No functional change intended.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

It is an improvement, but I bet this is going to trip you or me up on
the next relevant security backport.  Just something to be aware of.

~Andrew


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-09 17:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-09 15:26 [PATCH] build: move double-$ into as-option-add Jan Beulich
2023-02-09 17:14 ` Anthony PERARD
2023-02-09 17:16 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.