Anna Karaś has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43999 )
Change subject: src/lib: Remove unused function parameter in imd.c ......................................................................
src/lib: Remove unused function parameter in imd.c
Remove const struct imdr *imdr parameter from the prototypes of imdr_entry_size(), imd_entry_size() and imd_entry_id() functions since it is not used anywhere.
Signed-off-by: Anna Karas aka@semihalf.com Change-Id: I6b43e9a5ae1f1d108024b4060a04c57f5d77fb55 --- M src/include/imd.h M src/lib/ext_stage_cache.c M src/lib/imd.c M src/lib/imd_cbmem.c 4 files changed, 14 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/43999/1
diff --git a/src/include/imd.h b/src/include/imd.h index 314d223..7abbb98 100644 --- a/src/include/imd.h +++ b/src/include/imd.h @@ -102,13 +102,13 @@ uint32_t id, size_t size);
/* Returns size of entry or 0 on failure. */ -size_t imd_entry_size(const struct imd *imd, const struct imd_entry *entry); +size_t imd_entry_size(const struct imd_entry *entry);
/* Returns pointer to region described by entry or NULL on failure. */ void *imd_entry_at(const struct imd *imd, const struct imd_entry *entry);
/* Returns id for the imd entry. */ -uint32_t imd_entry_id(const struct imd *imd, const struct imd_entry *entry); +uint32_t imd_entry_id(const struct imd_entry *entry);
/* Attempt to remove entry from imd. */ int imd_entry_remove(const struct imd *imd, const struct imd_entry *entry); diff --git a/src/lib/ext_stage_cache.c b/src/lib/ext_stage_cache.c index 2fb1e9e..d498597 100644 --- a/src/lib/ext_stage_cache.c +++ b/src/lib/ext_stage_cache.c @@ -111,7 +111,7 @@ }
*base = imd_entry_at(imd, e); - *size = imd_entry_size(imd, e); + *size = imd_entry_size(e); }
void stage_cache_load_stage(int stage_id, struct prog *stage) @@ -141,7 +141,7 @@ }
c = imd_entry_at(imd, e); - size = imd_entry_size(imd, e); + size = imd_entry_size(e);
memcpy((void *)(uintptr_t)meta->load_addr, c, size);
diff --git a/src/lib/imd.c b/src/lib/imd.c index e19c03d..be4a786 100644 --- a/src/lib/imd.c +++ b/src/lib/imd.c @@ -288,8 +288,7 @@ return 0; }
-static size_t imdr_entry_size(const struct imdr *imdr, - const struct imd_entry *e) +static size_t imdr_entry_size(const struct imd_entry *e) { return e->size; } @@ -409,7 +408,7 @@ return;
imd->sm.limit = (uintptr_t)imdr_entry_at(imdr, e); - imd->sm.limit += imdr_entry_size(imdr, e); + imd->sm.limit += imdr_entry_size(e); imdr = &imd->sm; rp = imdr_get_root_pointer(imdr); imdr->r = relative_pointer(rp, rp->root_offset); @@ -474,7 +473,7 @@ return 0;
small_upper_limit = (uintptr_t)imdr_entry_at(imdr, e); - small_upper_limit += imdr_entry_size(imdr, e); + small_upper_limit += imdr_entry_size(e);
imd->sm.limit = small_upper_limit;
@@ -592,9 +591,9 @@ return imd_entry_add(imd, id, size); }
-size_t imd_entry_size(const struct imd *imd, const struct imd_entry *entry) +size_t imd_entry_size(const struct imd_entry *entry) { - return imdr_entry_size(NULL, entry); + return imdr_entry_size(entry); }
void *imd_entry_at(const struct imd *imd, const struct imd_entry *entry) @@ -609,7 +608,7 @@ return imdr_entry_at(imdr, entry); }
-uint32_t imd_entry_id(const struct imd *imd, const struct imd_entry *entry) +uint32_t imd_entry_id(const struct imd_entry *entry) { return entry->id; } @@ -671,7 +670,7 @@ printk(BIOS_DEBUG, "%s", name); printk(BIOS_DEBUG, "%2zu. ", i); printk(BIOS_DEBUG, "%p ", imdr_entry_at(imdr, e)); - printk(BIOS_DEBUG, "0x%08zx\n", imdr_entry_size(imdr, e)); + printk(BIOS_DEBUG, "0x%08zx\n", imdr_entry_size(e)); } }
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c index cb66c3b..7638e0e 100644 --- a/src/lib/imd_cbmem.c +++ b/src/lib/imd_cbmem.c @@ -178,7 +178,7 @@
u64 cbmem_entry_size(const struct cbmem_entry *entry) { - return imd_entry_size(&imd, cbmem_to_imd(entry)); + return imd_entry_size(cbmem_to_imd(entry)); }
void *cbmem_entry_start(const struct cbmem_entry *entry) @@ -232,7 +232,7 @@ if (e == NULL) break;
- id = imd_entry_id(&imd, e); + id = imd_entry_id(e); /* Don't add these metadata entries. */ if (id == CBMEM_ID_IMD_ROOT || id == CBMEM_ID_IMD_SMALL) continue; @@ -241,7 +241,7 @@ lbe->tag = LB_TAG_CBMEM_ENTRY; lbe->size = sizeof(*lbe); lbe->address = (uintptr_t)imd_entry_at(&imd, e); - lbe->entry_size = imd_entry_size(&imd, e); + lbe->entry_size = imd_entry_size(e); lbe->id = id; } }