Messages in this thread Patch in this message | | | From | Atish Patra <> | Subject | [PATCH 3/4] RISC-V: Support case insensitive ISA string parsing. | Date | Fri, 26 Jul 2019 12:46:37 -0700 |
| |
As per riscv specification, ISA naming strings are case insensitive. However, currently only lower case strings are parsed during cpu procfs.
Support parsing of upper case letters as well.
Signed-off-by: Atish Patra <atish.patra@wdc.com> --- arch/riscv/kernel/cpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 7da3c6a93abd..185143478830 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -5,6 +5,7 @@ #include <linux/init.h> #include <linux/seq_file.h> +#include <linux/ctype.h> #include <linux/of.h> #include <asm/smp.h> @@ -57,10 +58,10 @@ static void print_isa(struct seq_file *f, const char *orig_isa) * kernels on harts with the same ISA that the kernel is compiled for. */ #if defined(CONFIG_32BIT) - if (strncmp(isa, "rv32i", 5) != 0) + if (strncasecmp(isa, "rv32i", 5) != 0) return; #elif defined(CONFIG_64BIT) - if (strncmp(isa, "rv64i", 5) != 0) + if (strncasecmp(isa, "rv64i", 5) != 0) return; #endif @@ -76,8 +77,8 @@ static void print_isa(struct seq_file *f, const char *orig_isa) * extension from userspace as it's not accessible from there. */ for (e = ext; *e != '\0'; ++e) { - if (isa[0] == e[0]) { - if (isa[0] != 's') + if (tolower(isa[0]) == e[0]) { + if (tolower(isa[0] != 's')) seq_write(f, isa, 1); isa++; -- 2.21.0
| |