summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2020-11-01 21:04:55 +0100
committerPatrick Georgi <pgeorgi@google.com>2020-11-16 12:07:50 +0000
commitb17f11e19d50ea0c34eabdc4c7189291fb96536a (patch)
tree10ac5fee3190bfef785cd8f07651aaed8c976052 /src/cpu
parentfd8619e665416fe1d7b7b4c1e69a7ceb1ea58ef8 (diff)
cpu/x86/smm/smm_module_loaderv2.c: Use more variables
Reusing the 'size' variable for a different purpose later on in the function makes the code harder to read. Change-Id: Iceb10aa40ad473b41b7da0310554725585e3c2c2 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47070 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: David Hendricks <david.hendricks@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/x86/smm/smm_module_loaderv2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cpu/x86/smm/smm_module_loaderv2.c b/src/cpu/x86/smm/smm_module_loaderv2.c
index 3fa58717d8..4bc385fc85 100644
--- a/src/cpu/x86/smm/smm_module_loaderv2.c
+++ b/src/cpu/x86/smm/smm_module_loaderv2.c
@@ -413,12 +413,14 @@ static int smm_module_setup_stub(void *smbase, size_t smm_size,
* for default handler, but for relocated handler it lives at the beginning
* of SMRAM which is TSEG base
*/
- size = params->num_concurrent_stacks * params->per_cpu_stack_size;
- stacks_top = smm_stub_place_stacks((char *)params->smram_start, size, params);
+ const size_t total_stack_size = params->num_concurrent_stacks *
+ params->per_cpu_stack_size;
+ stacks_top = smm_stub_place_stacks((char *)params->smram_start, total_stack_size,
+ params);
if (stacks_top == NULL) {
printk(BIOS_ERR, "%s: not enough space for stacks\n", __func__);
printk(BIOS_ERR, "%s: ....need -> %p : available -> %zx\n", __func__,
- base, size);
+ base, total_stack_size);
return -1;
}
params->stack_top = stacks_top;