Skip to content

Commit 1c3ace2

Browse files
Quentin PerretMarc Zyngier
authored andcommitted
KVM: arm64: Don't return from void function
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: e9ee186 ("KVM: arm64: Add kvm_extable for vaxorcism code") Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 40c56bd commit 1c3ace2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/arm64/kvm/hyp/nvhe/switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,5 +386,5 @@ asmlinkage void __noreturn hyp_panic_bad_stack(void)
386386

387387
asmlinkage void kvm_unexpected_el2_exception(void)
388388
{
389-
return __kvm_unexpected_el2_exception();
389+
__kvm_unexpected_el2_exception();
390390
}

arch/arm64/kvm/hyp/vhe/switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,5 +249,5 @@ void __noreturn hyp_panic(void)
249249

250250
asmlinkage void kvm_unexpected_el2_exception(void)
251251
{
252-
return __kvm_unexpected_el2_exception();
252+
__kvm_unexpected_el2_exception();
253253
}

0 commit comments

Comments
 (0)