summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2019-11-29 12:14:30 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-30 19:25:29 +0000
commitcd666d992de9db8f207d997a6a65373904785a09 (patch)
tree1eacdc4407b658c50b305fd2a8b85da4245cc0e4
parentbc2204edd24eab1162613fe610746a63ec1a66c0 (diff)
lib/imd_cbmem: Remove indirection through cbmem_get_imd()
It always returns the same pointer so why not use the pointer directly? Change-Id: Ib5a13edc7f3ab05c3baf9956ab67031507bdddc1 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37360 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/lib/imd_cbmem.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c
index 6fd48d57dd..d7f7d20f25 100644
--- a/src/lib/imd_cbmem.c
+++ b/src/lib/imd_cbmem.c
@@ -43,11 +43,7 @@ void *cbmem_top(void)
}
-static inline struct imd *cbmem_get_imd(void)
-{
- static struct imd imd_cbmem;
- return &imd_cbmem;
-}
+static struct imd imd_cbmem;
static inline const struct cbmem_entry *imd_to_cbmem(const struct imd_entry *e)
{
@@ -75,7 +71,7 @@ static struct imd *imd_init_backing(struct imd *backing)
{
struct imd *imd;
- imd = cbmem_get_imd();
+ imd = &imd_cbmem;
if (imd != NULL)
return imd;
@@ -288,7 +284,7 @@ void cbmem_add_bootmem(void)
void cbmem_get_region(void **baseptr, size_t *size)
{
- imd_region_used(cbmem_get_imd(), baseptr, size);
+ imd_region_used(&imd_cbmem, baseptr, size);
}
#if ENV_PAYLOAD_LOADER || (CONFIG(EARLY_CBMEM_LIST) \
@@ -314,7 +310,7 @@ void cbmem_add_records_to_cbtable(struct lb_header *header)
struct imd_cursor cursor;
struct imd *imd;
- imd = cbmem_get_imd();
+ imd = &imd_cbmem;
if (imd_cursor_init(imd, &cursor))
return;