virt/coco/sev-guest: Convert the sw_exit_info_2 checking to a switch-case
authorBorislav Petkov (AMD) <bp@alien8.de>
Thu, 16 Feb 2023 09:50:11 +0000 (10:50 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 13 Mar 2023 11:55:34 +0000 (12:55 +0100)
commitfa4ae42cc60a7dea30e8f2db444b808d80862345
tree4bd250b5fa6a5fc7fb2a0b4714a3c2d8bd10984a
parentd25bae7dc7b0668cb2a1325c64eb32d5fea4e5a9
virt/coco/sev-guest: Convert the sw_exit_info_2 checking to a switch-case

snp_issue_guest_request() checks the value returned by the hypervisor in
sw_exit_info_2 and returns a different error depending on it.

Convert those checks into a switch-case to make it more readable when
more error values are going to be checked in the future.

No functional changes.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20230307192449.24732-8-bp@alien8.de
arch/x86/kernel/sev.c