Skip to content

Commit 48ef9e8

Browse files
rddunlapchenhuacai
authored andcommitted
LoongArch: KVM: Add returns to SIMD stubs
The stubs for kvm_own/lsx()/kvm_own_lasx() when CONFIG_CPU_HAS_LSX or CONFIG_CPU_HAS_LASX is not defined should have a return value since they return an int, so add "return -EINVAL;" to the stubs. Fixes the build error: In file included from ../arch/loongarch/include/asm/kvm_csr.h:12, from ../arch/loongarch/kvm/interrupt.c:8: ../arch/loongarch/include/asm/kvm_vcpu.h: In function 'kvm_own_lasx': ../arch/loongarch/include/asm/kvm_vcpu.h:73:39: error: no return statement in function returning non-void [-Werror=return-type] 73 | static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { } Fixes: db1ecca ("LoongArch: KVM: Add LSX (128bit SIMD) support") Fixes: 118e10c ("LoongArch: KVM: Add LASX (256bit SIMD) support") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 614f362 commit 48ef9e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/loongarch/include/asm/kvm_vcpu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int kvm_own_lsx(struct kvm_vcpu *vcpu);
6060
void kvm_save_lsx(struct loongarch_fpu *fpu);
6161
void kvm_restore_lsx(struct loongarch_fpu *fpu);
6262
#else
63-
static inline int kvm_own_lsx(struct kvm_vcpu *vcpu) { }
63+
static inline int kvm_own_lsx(struct kvm_vcpu *vcpu) { return -EINVAL; }
6464
static inline void kvm_save_lsx(struct loongarch_fpu *fpu) { }
6565
static inline void kvm_restore_lsx(struct loongarch_fpu *fpu) { }
6666
#endif
@@ -70,7 +70,7 @@ int kvm_own_lasx(struct kvm_vcpu *vcpu);
7070
void kvm_save_lasx(struct loongarch_fpu *fpu);
7171
void kvm_restore_lasx(struct loongarch_fpu *fpu);
7272
#else
73-
static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }
73+
static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { return -EINVAL; }
7474
static inline void kvm_save_lasx(struct loongarch_fpu *fpu) { }
7575
static inline void kvm_restore_lasx(struct loongarch_fpu *fpu) { }
7676
#endif

0 commit comments

Comments
 (0)