KVM: arm64: Replace ternary flags with str_on_off() helper
authorSeongsu Park <sgsu.park@samsung.com>
Tue, 15 Apr 2025 01:24:05 +0000 (10:24 +0900)
committerMarc Zyngier <maz@kernel.org>
Tue, 6 May 2025 08:38:37 +0000 (09:38 +0100)
Replace repetitive ternary expressions with the str_on_off() helper
function. This change improves code readability and ensures consistency
in tracepoint string formatting

Signed-off-by: Seongsu Park <sgsu.park@samsung.com>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/1891546521.01744691102904.JavaMail.epsvc@epcpadp1new
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/trace_arm.h

index c18c1a95831e1bb9bef1fa167d54527a3da3cc45..9c60f6465c787228eeb041e39fac49f6d12f0c1b 100644 (file)
@@ -176,7 +176,7 @@ TRACE_EVENT(kvm_set_way_flush,
            ),
 
            TP_printk("S/W flush at 0x%016lx (cache %s)",
-                     __entry->vcpu_pc, __entry->cache ? "on" : "off")
+                     __entry->vcpu_pc, str_on_off(__entry->cache))
 );
 
 TRACE_EVENT(kvm_toggle_cache,
@@ -196,8 +196,8 @@ TRACE_EVENT(kvm_toggle_cache,
            ),
 
            TP_printk("VM op at 0x%016lx (cache was %s, now %s)",
-                     __entry->vcpu_pc, __entry->was ? "on" : "off",
-                     __entry->now ? "on" : "off")
+                     __entry->vcpu_pc, str_on_off(__entry->was),
+                     str_on_off(__entry->now))
 );
 
 /*