[PATCH 1/4] riscv: Don't duplicate __ALTERNATIVE_CFG in __ALTERNATIVE_CFG_2

Andrew Jones ajones at ventanamicro.com
Fri Nov 25 05:06:47 PST 2022


On Fri, Nov 25, 2022 at 12:39:56PM +0100, Andrew Jones wrote:
> Build __ALTERNATIVE_CFG_2 by adding on to __ALTERNATIVE_CFG rather
> than duplicating it.
> 
> Signed-off-by: Andrew Jones <ajones at ventanamicro.com>
> ---
>  arch/riscv/include/asm/alternative-macros.h | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h
> index ec2f3f1b836f..64be770df89a 100644
> --- a/arch/riscv/include/asm/alternative-macros.h
> +++ b/arch/riscv/include/asm/alternative-macros.h
> @@ -49,14 +49,7 @@
>  
>  .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
> -886 :
> -	.option push
> -	.option norvc
> -	.option norelax
> -	\old_c
> -	.option pop
> -887 :
> -	ALT_NEW_CONTENT \vendor_id_1, \errata_id_1, \enable_1, \new_c_1
> +	__ALTERNATIVE_CFG old_c, new_c_1, vendor_id_1, errata_id_1, enable_1

I just realized that I forgot my slashes on these macro arguments.

I'll wait for other feedback before sending a v2.

Thanks,
drew

>  	ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2
>  .endm
>  
> @@ -116,14 +109,7 @@
>  					enable_1,			\
>  				   new_c_2, vendor_id_2, errata_id_2,	\
>  					enable_2)			\
> -	"886 :\n"							\
> -	".option push\n"						\
> -	".option norvc\n"						\
> -	".option norelax\n"						\
> -	old_c "\n"							\
> -	".option pop\n"							\
> -	"887 :\n"							\
> -	ALT_NEW_CONTENT(vendor_id_1, errata_id_1, enable_1, new_c_1)	\
> +	__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)
>  
>  #define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1,	\
> -- 
> 2.38.1
> 



More information about the linux-riscv mailing list