Skip to content

Commit 0621210

Browse files
ColinIanKingsuryasaimadhu
authored andcommitted
x86/sev: Remove duplicated assignment to variable info
Variable info is being assigned the same value twice, remove the redundant assignment. Also assign variable v in the declaration. Cleans up clang scan warning: warning: Value stored to 'info' during its initialization is never read [deadcode.DeadStores] No code changed: # arch/x86/kernel/sev.o: text data bss dec hex filename 19878 4487 4112 28477 6f3d sev.o.before 19878 4487 4112 28477 6f3d sev.o.after md5: bfbaa515af818615fd01fea91e7eba1b sev.o.before.asm bfbaa515af818615fd01fea91e7eba1b sev.o.after.asm [ bp: Running the before/after check on sev.c because sev-shared.c gets included into it. ] Fixes: 597cfe4 ("x86/boot/compressed/64: Setup a GHCB-based VC Exception handler") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/20220516184215.51841-1-colin.i.king@gmail.com
1 parent ab65f49 commit 0621210

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

arch/x86/kernel/sev-shared.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,7 @@ static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt
201201

202202
if (ret == 1) {
203203
u64 info = ghcb->save.sw_exit_info_2;
204-
unsigned long v;
205-
206-
info = ghcb->save.sw_exit_info_2;
207-
v = info & SVM_EVTINJ_VEC_MASK;
204+
unsigned long v = info & SVM_EVTINJ_VEC_MASK;
208205

209206
/* Check if exception information from hypervisor is sane. */
210207
if ((info & SVM_EVTINJ_VALID) &&

0 commit comments

Comments
 (0)