diff mbox series

[v2,3/4] riscv: alternatives: Drop the underscores from the assembly macro names

Message ID 20221129150053.50464-4-ajones@ventanamicro.com (mailing list archive)
State Accepted
Commit bb2efcde594628ae08ee6e4be51b2047df9d2d06
Delegated to: Palmer Dabbelt
Headers show
Series [v2,1/4] riscv: Don't duplicate __ALTERNATIVE_CFG in __ALTERNATIVE_CFG_2 | expand

Checks

Context Check Description
conchuod/patch_count success Link
conchuod/cover_letter warning Series does not have a cover letter
conchuod/tree_selection success Guessed tree name to be for-next
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/module_param success Was 0 now: 0
conchuod/build_rv32_defconfig success Build OK
conchuod/build_warn_rv64 success Errors and warnings before: 0 this patch: 0
conchuod/dtb_warn_rv64 success Errors and warnings before: 0 this patch: 0
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch warning WARNING: Avoid unnecessary line continuations
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Andrew Jones Nov. 29, 2022, 3 p.m. UTC
The underscores aren't needed because there isn't anything already
named without them and the _CFG extension. This is a bit of a cleanup
by itself, but the real motivation is for a coming patch which would
otherwise need to add two more underscores to these macro names,
i.e. ____ALTERNATIVE_CFG, and that'd be gross.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
 arch/riscv/include/asm/alternative-macros.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Heiko Stübner Nov. 30, 2022, 10:06 a.m. UTC | #1
Am Dienstag, 29. November 2022, 16:00:52 CET schrieb Andrew Jones:
> The underscores aren't needed because there isn't anything already
> named without them and the _CFG extension. This is a bit of a cleanup
> by itself, but the real motivation is for a coming patch which would
> otherwise need to add two more underscores to these macro names,
> i.e. ____ALTERNATIVE_CFG, and that'd be gross.
> 
> Signed-off-by: Andrew Jones <ajones@ventanamicro.com>

Hmm, I would assume the "_" are there to mark those as
"internal / don't use". So with removing the underscores
you loose that marking.

It works though, so
Tested-by: Heiko Stuebner <heiko.stuebner@vrull.eu>

But I'll leave the judgement on its viability to others.

Heiko

> ---
>  arch/riscv/include/asm/alternative-macros.h | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h
> index 7cc2b587c5c4..9ea95331a280 100644
> --- a/arch/riscv/include/asm/alternative-macros.h
> +++ b/arch/riscv/include/asm/alternative-macros.h
> @@ -33,7 +33,7 @@
>  	.endif
>  .endm
>  
> -.macro __ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable
> +.macro ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable
>  886 :
>  	.option push
>  	.option norvc
> @@ -45,11 +45,11 @@
>  .endm
>  
>  #define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \
> -	__ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)
> +	ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)
>  
> -.macro __ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \
> -				  new_c_2, vendor_id_2, errata_id_2, enable_2
> -	__ALTERNATIVE_CFG \old_c, \new_c_1, \vendor_id_1, \errata_id_1, \enable_1
> +.macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1,	\
> +				new_c_2, vendor_id_2, errata_id_2, enable_2
> +	ALTERNATIVE_CFG \old_c, \new_c_1, \vendor_id_1, \errata_id_1, \enable_1
>  	ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2
>  .endm
>  
> @@ -57,9 +57,9 @@
>  					CONFIG_k_1,			\
>  				  new_c_2, vendor_id_2, errata_id_2,	\
>  					CONFIG_k_2)			\
> -	__ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1,	\
> +	ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1,	\
>  					IS_ENABLED(CONFIG_k_1),		\
> -				   new_c_2, vendor_id_2, errata_id_2,	\
> +				 new_c_2, vendor_id_2, errata_id_2,	\
>  					IS_ENABLED(CONFIG_k_2)
>  
>  #else /* !__ASSEMBLY__ */
> @@ -126,15 +126,15 @@
>  #else /* CONFIG_RISCV_ALTERNATIVE */
>  #ifdef __ASSEMBLY__
>  
> -.macro __ALTERNATIVE_CFG old_c
> +.macro ALTERNATIVE_CFG old_c
>  	\old_c
>  .endm
>  
>  #define _ALTERNATIVE_CFG(old_c, ...)	\
> -	__ALTERNATIVE_CFG old_c
> +	ALTERNATIVE_CFG old_c
>  
>  #define _ALTERNATIVE_CFG_2(old_c, ...)	\
> -	__ALTERNATIVE_CFG old_c
> +	ALTERNATIVE_CFG old_c
>  
>  #else /* !__ASSEMBLY__ */
>  
>
Andrew Jones Nov. 30, 2022, 11:27 a.m. UTC | #2
On Wed, Nov 30, 2022 at 11:06:27AM +0100, Heiko Stübner wrote:
> Am Dienstag, 29. November 2022, 16:00:52 CET schrieb Andrew Jones:
> > The underscores aren't needed because there isn't anything already
> > named without them and the _CFG extension. This is a bit of a cleanup
> > by itself, but the real motivation is for a coming patch which would
> > otherwise need to add two more underscores to these macro names,
> > i.e. ____ALTERNATIVE_CFG, and that'd be gross.
> > 
> > Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
> 
> Hmm, I would assume the "_" are there to mark those as
> "internal / don't use". So with removing the underscores
> you loose that marking.

Yeah, that's usually the case, but here we also have ALT_ENTRY and
ALT_NEW_CONTENT macros which are also internal, but don't have
leading-underscore names.

> 
> It works though, so
> Tested-by: Heiko Stuebner <heiko.stuebner@vrull.eu>

Thanks,
drew

> 
> But I'll leave the judgement on its viability to others.
> 
> Heiko
> 
> > ---
> >  arch/riscv/include/asm/alternative-macros.h | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> > 
> > diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h
> > index 7cc2b587c5c4..9ea95331a280 100644
> > --- a/arch/riscv/include/asm/alternative-macros.h
> > +++ b/arch/riscv/include/asm/alternative-macros.h
> > @@ -33,7 +33,7 @@
> >  	.endif
> >  .endm
> >  
> > -.macro __ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable
> > +.macro ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable
> >  886 :
> >  	.option push
> >  	.option norvc
> > @@ -45,11 +45,11 @@
> >  .endm
> >  
> >  #define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \
> > -	__ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)
> > +	ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)
> >  
> > -.macro __ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \
> > -				  new_c_2, vendor_id_2, errata_id_2, enable_2
> > -	__ALTERNATIVE_CFG \old_c, \new_c_1, \vendor_id_1, \errata_id_1, \enable_1
> > +.macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1,	\
> > +				new_c_2, vendor_id_2, errata_id_2, enable_2
> > +	ALTERNATIVE_CFG \old_c, \new_c_1, \vendor_id_1, \errata_id_1, \enable_1
> >  	ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2
> >  .endm
> >  
> > @@ -57,9 +57,9 @@
> >  					CONFIG_k_1,			\
> >  				  new_c_2, vendor_id_2, errata_id_2,	\
> >  					CONFIG_k_2)			\
> > -	__ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1,	\
> > +	ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1,	\
> >  					IS_ENABLED(CONFIG_k_1),		\
> > -				   new_c_2, vendor_id_2, errata_id_2,	\
> > +				 new_c_2, vendor_id_2, errata_id_2,	\
> >  					IS_ENABLED(CONFIG_k_2)
> >  
> >  #else /* !__ASSEMBLY__ */
> > @@ -126,15 +126,15 @@
> >  #else /* CONFIG_RISCV_ALTERNATIVE */
> >  #ifdef __ASSEMBLY__
> >  
> > -.macro __ALTERNATIVE_CFG old_c
> > +.macro ALTERNATIVE_CFG old_c
> >  	\old_c
> >  .endm
> >  
> >  #define _ALTERNATIVE_CFG(old_c, ...)	\
> > -	__ALTERNATIVE_CFG old_c
> > +	ALTERNATIVE_CFG old_c
> >  
> >  #define _ALTERNATIVE_CFG_2(old_c, ...)	\
> > -	__ALTERNATIVE_CFG old_c
> > +	ALTERNATIVE_CFG old_c
> >  
> >  #else /* !__ASSEMBLY__ */
> >  
> > 
> 
> 
> 
>
diff mbox series

Patch

diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h
index 7cc2b587c5c4..9ea95331a280 100644
--- a/arch/riscv/include/asm/alternative-macros.h
+++ b/arch/riscv/include/asm/alternative-macros.h
@@ -33,7 +33,7 @@ 
 	.endif
 .endm
 
-.macro __ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable
+.macro ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable
 886 :
 	.option push
 	.option norvc
@@ -45,11 +45,11 @@ 
 .endm
 
 #define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \
-	__ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)
+	ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)
 
-.macro __ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \
-				  new_c_2, vendor_id_2, errata_id_2, enable_2
-	__ALTERNATIVE_CFG \old_c, \new_c_1, \vendor_id_1, \errata_id_1, \enable_1
+.macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1,	\
+				new_c_2, vendor_id_2, errata_id_2, enable_2
+	ALTERNATIVE_CFG \old_c, \new_c_1, \vendor_id_1, \errata_id_1, \enable_1
 	ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2
 .endm
 
@@ -57,9 +57,9 @@ 
 					CONFIG_k_1,			\
 				  new_c_2, vendor_id_2, errata_id_2,	\
 					CONFIG_k_2)			\
-	__ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1,	\
+	ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1,	\
 					IS_ENABLED(CONFIG_k_1),		\
-				   new_c_2, vendor_id_2, errata_id_2,	\
+				 new_c_2, vendor_id_2, errata_id_2,	\
 					IS_ENABLED(CONFIG_k_2)
 
 #else /* !__ASSEMBLY__ */
@@ -126,15 +126,15 @@ 
 #else /* CONFIG_RISCV_ALTERNATIVE */
 #ifdef __ASSEMBLY__
 
-.macro __ALTERNATIVE_CFG old_c
+.macro ALTERNATIVE_CFG old_c
 	\old_c
 .endm
 
 #define _ALTERNATIVE_CFG(old_c, ...)	\
-	__ALTERNATIVE_CFG old_c
+	ALTERNATIVE_CFG old_c
 
 #define _ALTERNATIVE_CFG_2(old_c, ...)	\
-	__ALTERNATIVE_CFG old_c
+	ALTERNATIVE_CFG old_c
 
 #else /* !__ASSEMBLY__ */