[RFC 5/6] RISC-V: drop a needless check in print_isa_ext()
Conor Dooley
conor at kernel.org
Mon May 8 11:16:25 PDT 2023
From: Conor Dooley <conor.dooley at microchip.com>
There'll always be elements in the array, even if none of the
optional bits of support are built into the kernel.
Signed-off-by: Conor Dooley <conor.dooley at microchip.com>
---
arch/riscv/kernel/cpu.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c
index c29643dca0f7..bc32207b7d86 100644
--- a/arch/riscv/kernel/cpu.c
+++ b/arch/riscv/kernel/cpu.c
@@ -176,15 +176,8 @@ arch_initcall(riscv_cpuinfo_init);
#ifdef CONFIG_PROC_FS
static void print_isa_ext(struct seq_file *f)
{
- int i = 0, arr_sz;
- arr_sz = riscv_isa_extensions_count - 1;
-
- /* No extension support available */
- if (arr_sz <= 0)
- return;
-
- for (i = 0; i < arr_sz; i++) {
+ for (int i = 0; i < riscv_isa_extensions_count - 1; i++) {
if (!__riscv_isa_extension_available(NULL, riscv_isa_extensions[i].key))
continue;
if (riscv_isa_extensions[i].multi_letter)
--
2.39.2
More information about the linux-riscv
mailing list