From 72b2022b31e6ee8d6d81a3761b90df2df88ba8a8 Mon Sep 17 00:00:00 2001 From: Richard Spiegel Date: Fri, 10 Aug 2018 16:13:00 -0700 Subject: cpu/x86/smm/smm_module_loader.c: Avoid static analysis error "unused value" In procedure smm_load_module, variables fxsave_size and fxsave_area are set to 0 and NULL, but if CONFIG_SSE is enabled, they are overwritten. Change the code setting the value to an "else" of the "if" testing CONFIG_SSE, thus avoiding static analysis error. BUG=b:112253891 TEST=Build and boot grunt. Change-Id: I3042b037017a082378b53ee419c769c535632038 Signed-off-by: Richard Spiegel Reviewed-on: https://review.coreboot.org/28023 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Paul Menzel --- src/cpu/x86/smm/smm_module_loader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c index e92fa05e13..797268627a 100644 --- a/src/cpu/x86/smm/smm_module_loader.c +++ b/src/cpu/x86/smm/smm_module_loader.c @@ -371,13 +371,14 @@ int smm_load_module(void *smram, size_t size, struct smm_loader_params *params) base += alignment_size; } - fxsave_size = 0; - fxsave_area = NULL; if (IS_ENABLED(CONFIG_SSE)) { fxsave_size = FXSAVE_SIZE * params->num_concurrent_stacks; /* FXSAVE area below all the stacks stack. */ fxsave_area = params->stack_top; fxsave_area -= total_stack_size + fxsave_size; + } else { + fxsave_size = 0; + fxsave_area = NULL; } /* Does the required amount of memory exceed the SMRAM region size? */ -- cgit v1.2.3