lkml.org 
[lkml]   [2021]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86/sev: clean up initialization of variables info and v
Date
Currently variable info is being assigned twice, the second assignment
is redundant. Clean up the code by making the assignments at declaration
time and remove the latter two assignments.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
arch/x86/kernel/sev-shared.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c
index ce987688bbc0..6083d6f658c8 100644
--- a/arch/x86/kernel/sev-shared.c
+++ b/arch/x86/kernel/sev-shared.c
@@ -104,10 +104,7 @@ static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt

if (ret == 1) {
u64 info = ghcb->save.sw_exit_info_2;
- unsigned long v;
-
- info = ghcb->save.sw_exit_info_2;
- v = info & SVM_EVTINJ_VEC_MASK;
+ unsigned long v = info & SVM_EVTINJ_VEC_MASK;

/* Check if exception information from hypervisor is sane. */
if ((info & SVM_EVTINJ_VALID) &&
--
2.33.1
\
 
 \ /
  Last update: 2021-11-26 23:40    [W:0.074 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site