]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: avoid unused-variable warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 13 Mar 2026 09:49:16 +0000 (10:49 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 17 Mar 2026 09:16:35 +0000 (09:16 +0000)
commit8510d054b7e086a71a9191ac3399231290dfd272
tree54dd1686133ff78f127b211753f8de0c09971d64
parent1211907ac0b5f35e5720620c50b7ca3c72d81f7e
KVM: arm64: avoid unused-variable warning

The 'cpu' variable is only used inside of an #ifdef block and causes
a warning if there is no user:

arch/arm64/kvm/hyp_trace.c: In function 'kvm_hyp_trace_init':
arch/arm64/kvm/hyp_trace.c:422:13: error: unused variable 'cpu' [-Werror=unused-variable]
  422 |         int cpu;
      |             ^~~

Change the #ifdef to an equivalent IS_ENABLED() check to avoid
the warning.

Fixes: b22888917fa4 ("KVM: arm64: Sync boot clock with the nVHE/pKVM hyp")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://patch.msgid.link/20260313094925.3749287-1-arnd@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp_trace.c