diff mbox series

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

Message ID 20230221185603.570882-3-ajones@ventanamicro.com (mailing list archive)
State Superseded
Headers show
Series riscv: alternative/cpufeature related cleanups | expand

Checks

Context Check Description
conchuod/cover_letter success Series has a cover letter
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 13 and now 13
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 2435 this patch: 2435
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 17147 this patch: 17147
conchuod/alphanumeric_selects success Out of order selects before the patch: 727 and now 727
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 2 this patch: 2
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 27 lines checked
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
conchuod/tree_selection fail Failed to apply to next/pending-fixes or riscv/for-next

Commit Message

Andrew Jones Feb. 21, 2023, 6:56 p.m. UTC
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@ventanamicro.com>
---
 arch/riscv/errata/sifive/errata.c    | 2 +-
 arch/riscv/include/asm/alternative.h | 7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)

Comments

Conor Dooley Feb. 23, 2023, 11:14 p.m. UTC | #1
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@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@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@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Heiko Stuebner Feb. 24, 2023, 12:44 p.m. UTC | #2
Am Dienstag, 21. Februar 2023, 19:56:00 CET schrieb Andrew Jones:
> 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@ventanamicro.com>

Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
diff mbox series

Patch

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];
 	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);