]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/riscv: Use glib2 instead of strcasecmp/strncasecmp
authorKostiantyn Kostiuk <kkostiuk@redhat.com>
Fri, 27 Mar 2026 13:43:53 +0000 (15:43 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Apr 2026 10:27:27 +0000 (12:27 +0200)
This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-8-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/riscv/monitor.c

index a9d31114442040ae29643bea72aa1a56f90d0cea..bca04a7580caf0f6e91c901897425bbbbfc49762 100644 (file)
@@ -303,7 +303,7 @@ static bool reg_is_vreg(const char *name)
     }
 
     for (int i = 0; i < 32; i++) {
-        if (strcasecmp(name, riscv_rvv_regnames[i]) == 0) {
+        if (g_ascii_strcasecmp(name, riscv_rvv_regnames[i]) == 0) {
             return true;
         }
     }
@@ -358,7 +358,7 @@ int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)
             continue;
         }
 
-        if (strcasecmp(csr_ops[csrno].name, name) != 0) {
+        if (g_ascii_strcasecmp(csr_ops[csrno].name, name) != 0) {
             continue;
         }