[PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct

Conor Dooley conor at kernel.org
Thu Feb 23 15:14:26 PST 2023


On Tue, Feb 21, 2023 at 07:56:00PM +0100, Andrew Jones wrote:
> A define and a struct were introduced with commit 6f4eea90465a
> ("riscv: Introduce alternative mechanism to apply errata solution"),
> which introduced alternatives to RISC-V. The define is used for
> an arbitrary string length, specific to sifive errata, so just use
> the number directly there instead. The struct has never been used,
> so remove it.
> 
> Signed-off-by: Andrew Jones <ajones at ventanamicro.com>
> ---
>  arch/riscv/errata/sifive/errata.c    | 2 +-
>  arch/riscv/include/asm/alternative.h | 7 -------
>  2 files changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/arch/riscv/errata/sifive/errata.c b/arch/riscv/errata/sifive/errata.c
> index ef9a4eec0dba..9e7dffa800f2 100644
> --- a/arch/riscv/errata/sifive/errata.c
> +++ b/arch/riscv/errata/sifive/errata.c
> @@ -13,7 +13,7 @@
>  #include <asm/errata_list.h>
>  
>  struct errata_info_t {
> -	char name[ERRATA_STRING_LENGTH_MAX];
> +	char name[32];

If it were me, I'd probably have moved the define - but hardly matters,
it's a one time use, arbitrary number I suppose.
Reviewed-by: Conor Dooley <conor.dooley at microchip.com>

>  	bool (*check_func)(unsigned long  arch_id, unsigned long impid);
>  };
>  
> diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
> index b8648d4f2ac1..3beef400a971 100644
> --- a/arch/riscv/include/asm/alternative.h
> +++ b/arch/riscv/include/asm/alternative.h
> @@ -6,8 +6,6 @@
>  #ifndef __ASM_ALTERNATIVE_H
>  #define __ASM_ALTERNATIVE_H
>  
> -#define ERRATA_STRING_LENGTH_MAX 32
> -
>  #include <asm/alternative-macros.h>
>  
>  #ifndef __ASSEMBLY__
> @@ -43,11 +41,6 @@ struct alt_entry {
>  	u32 errata_id;		/* The errata id */
>  };
>  
> -struct errata_checkfunc_id {
> -	unsigned long vendor_id;
> -	bool (*func)(struct alt_entry *alt);
> -};
> -
>  void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
>  			      unsigned long archid, unsigned long impid,
>  			      unsigned int stage);
> -- 
> 2.39.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230223/fee035ac/attachment.sig>


More information about the linux-riscv mailing list