]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: kvm: sys_regs: use string choices helper
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 18 Jul 2025 01:50:24 +0000 (01:50 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 24 Jul 2025 06:36:37 +0000 (23:36 -0700)
We can use string choices helper, let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pldy5ktb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/sys_regs.h

index 76c2f0da821f8c992cc4a706555dc5b099438316..c131d6b0d35b2ac949a3050a8931fef75b61262f 100644 (file)
@@ -4475,7 +4475,7 @@ static bool kvm_esr_cp10_id_to_sys64(u64 esr, struct sys_reg_params *params)
                return true;
 
        kvm_pr_unimpl("Unhandled cp10 register %s: %u\n",
-                     params->is_write ? "write" : "read", reg_id);
+                     str_write_read(params->is_write), reg_id);
        return false;
 }
 
index ef97d9fc67cc536c291ff91ab6ccf9d4b2571198..317abc490368d08be690602bf56774f504bdc39e 100644 (file)
@@ -108,7 +108,7 @@ inline void print_sys_reg_msg(const struct sys_reg_params *p,
        /* Look, we even formatted it for you to paste into the table! */
        kvm_pr_unimpl("%pV { Op0(%2u), Op1(%2u), CRn(%2u), CRm(%2u), Op2(%2u), func_%s },\n",
                      &(struct va_format){ fmt, &va },
-                     p->Op0, p->Op1, p->CRn, p->CRm, p->Op2, p->is_write ? "write" : "read");
+                     p->Op0, p->Op1, p->CRn, p->CRm, p->Op2, str_write_read(p->is_write));
        va_end(va);
 }