]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: arm64: Don't return from void function
authorQuentin Perret <qperret@google.com>
Tue, 5 Jul 2022 14:23:10 +0000 (14:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:41:44 +0000 (14:41 +0200)
[ Upstream commit 1c3ace2b8b3995d3213c5e2d2aca01a0577a3b0f ]

Although harmless, the return statement in kvm_unexpected_el2_exception
is rather confusing as the function itself has a void return type. The
C standard is also pretty clear that "A return statement with an
expression shall not appear in a function whose return type is void".
Given that this return statement does not seem to add any actual value,
let's not pointlessly violate the standard.

Build-tested with GCC 10 and CLANG 13 for good measure, the disassembled
code is identical with or without the return statement.

Fixes: e9ee186bb735 ("KVM: arm64: Add kvm_extable for vaxorcism code")
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220705142310.3847918-1-qperret@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kvm/hyp/nvhe/switch.c
arch/arm64/kvm/hyp/vhe/switch.c

index 6410d21d86957d3b9e057e6412c2b91563e97c31..858e5be48791a5d69b9997f95c02b6965be01983 100644 (file)
@@ -371,5 +371,5 @@ void __noreturn hyp_panic(void)
 
 asmlinkage void kvm_unexpected_el2_exception(void)
 {
-       return __kvm_unexpected_el2_exception();
+       __kvm_unexpected_el2_exception();
 }
index 262dfe03134daba2f7c9669b115ae792cd5b15e1..51ea9ac7121031c57d7ae793684e02bec459c2c8 100644 (file)
@@ -240,5 +240,5 @@ void __noreturn hyp_panic(void)
 
 asmlinkage void kvm_unexpected_el2_exception(void)
 {
-       return __kvm_unexpected_el2_exception();
+       __kvm_unexpected_el2_exception();
 }