Skip to contentSkip to conversation

KVM: MIPS: Make kvm_mips_callbacks const

PATCH Applied Sean Christopherson 2 participants 3 messages Feb 24, 2023 – Mar 24, 2023

Subsystems (3)
lore
Share & tools
lore

Sean Christopherson

author reviewer
#0 lore raw

PATCH 1/1 KVM: MIPS: Make kvm_mips_callbacks const

Make kvm_mips_callbacks fully const as it's now hardcoded to point at kvm_vz_callbacks, the only remaining the set of callbacks.

---
 arch/mips/include/asm/kvm_host.h | 2 +-
 arch/mips/kvm/vz.c               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/kvm_host.h +1 -1
index 2803c9c21ef9..957121a495f0 100644
@@ -757,7 +757,7 @@ struct kvm_mips_callbacks {
 	int (*vcpu_run)(struct kvm_vcpu *vcpu);
 	void (*vcpu_reenter)(struct kvm_vcpu *vcpu);
 };
-extern struct kvm_mips_callbacks *kvm_mips_callbacks;
+extern const struct kvm_mips_callbacks * const kvm_mips_callbacks;
 int kvm_mips_emulation_init(void);
 
 /* Debug: dump vcpu state */
arch/mips/kvm/vz.c +1 -1
index dafab003ea0d..3d21cbfa7443 100644
@@ -3305,7 +3305,7 @@ static struct kvm_mips_callbacks kvm_vz_callbacks = {
 };
 
 /* FIXME: Get rid of the callbacks now that trap-and-emulate is gone. */
-struct kvm_mips_callbacks *kvm_mips_callbacks = &kvm_vz_callbacks;
+const struct kvm_mips_callbacks * const kvm_mips_callbacks = &kvm_vz_callbacks;
 
 int kvm_mips_emulation_init(void)
 {

base-commit: 3ad108511e1c19ff3a3fcb9a39b3eaebf4dd4054

Signature · 1 line
2.39.2.722.g9855ee24e9-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Sean Christopherson

Make kvm_mips_callbacks fully const as it's now hardcoded to point at kvm_vz_callbacks, the only remaining the set of callbacks.

---
  arch/mips/include/asm/kvm_host.h | 2 +-
  arch/mips/kvm/vz.c               | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

Thanks!