Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37360 )
Change subject: lib/imd_cbmem: Remove indirection through cbmem_get_imd() ......................................................................
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 --- M src/lib/imd_cbmem.c 1 file changed, 4 insertions(+), 8 deletions(-)
Approvals: build bot (Jenkins): Verified Kyösti Mälkki: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c index 6fd48d5..d7f7d20 100644 --- a/src/lib/imd_cbmem.c +++ b/src/lib/imd_cbmem.c @@ -43,11 +43,7 @@ }
-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 @@ { struct imd *imd;
- imd = cbmem_get_imd(); + imd = &imd_cbmem;
if (imd != NULL) return imd; @@ -288,7 +284,7 @@
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 @@ struct imd_cursor cursor; struct imd *imd;
- imd = cbmem_get_imd(); + imd = &imd_cbmem;
if (imd_cursor_init(imd, &cursor)) return;