Patch "KVM: arm64: Don't return from void function" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    KVM: arm64: Don't return from void function

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-arm64-don-t-return-from-void-function.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fc79abdfe36487f8aa6a66d763c7f01fd7063448
Author: Quentin Perret <qperret@xxxxxxxxxx>
Date:   Tue Jul 5 14:23:10 2022 +0000

    KVM: arm64: Don't return from void function
    
    [ 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@xxxxxxxxxx>
    Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220705142310.3847918-1-qperret@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c
index 6624596846d3..2401164c5f86 100644
--- a/arch/arm64/kvm/hyp/nvhe/switch.c
+++ b/arch/arm64/kvm/hyp/nvhe/switch.c
@@ -279,5 +279,5 @@ void __noreturn hyp_panic(void)
 
 asmlinkage void kvm_unexpected_el2_exception(void)
 {
-	return __kvm_unexpected_el2_exception();
+	__kvm_unexpected_el2_exception();
 }
diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switch.c
index 532e687f6936..99e2581e9806 100644
--- a/arch/arm64/kvm/hyp/vhe/switch.c
+++ b/arch/arm64/kvm/hyp/vhe/switch.c
@@ -228,5 +228,5 @@ void __noreturn hyp_panic(void)
 
 asmlinkage void kvm_unexpected_el2_exception(void)
 {
-	return __kvm_unexpected_el2_exception();
+	__kvm_unexpected_el2_exception();
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux