From 883a4c2b22e59f018b789fe6a0e1e52cc0443519 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 29 Mar 2023 15:54:26 +0200 Subject: [PATCH] soc/amd/common/block/cpu/noncar/memmap: simplify return value check Since the return value of the fsp_find_range_hob call is only used in one location, move the call and return value check into the if condition block to not need the status variable. Signed-off-by: Felix Held Change-Id: I4b9e9251368b86382dc4e050cf176db79dbfb230 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74081 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Felix Singer Reviewed-by: Matt DeVillier Reviewed-by: Fred Reitberger --- src/soc/amd/common/block/cpu/noncar/memmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/soc/amd/common/block/cpu/noncar/memmap.c b/src/soc/amd/common/block/cpu/noncar/memmap.c index 2661914876..097637ec21 100644 --- a/src/soc/amd/common/block/cpu/noncar/memmap.c +++ b/src/soc/amd/common/block/cpu/noncar/memmap.c @@ -38,7 +38,6 @@ void smm_region(uintptr_t *start, size_t *size) static int once; static uintptr_t smm_start; static size_t smm_size; - int status; *start = smm_start; *size = smm_size; @@ -46,9 +45,8 @@ void smm_region(uintptr_t *start, size_t *size) return; struct range_entry tseg; - status = fsp_find_range_hob(&tseg, AMD_FSP_TSEG_HOB_GUID.b); - if (status < 0) { + if (fsp_find_range_hob(&tseg, AMD_FSP_TSEG_HOB_GUID.b) < 0) { printk(BIOS_ERR, "unable to find TSEG HOB\n"); return; }