summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ext_stage_cache.c4
-rw-r--r--src/lib/imd.c15
-rw-r--r--src/lib/imd_cbmem.c6
3 files changed, 12 insertions, 13 deletions
diff --git a/src/lib/ext_stage_cache.c b/src/lib/ext_stage_cache.c
index 2fb1e9ee90..d498597d13 100644
--- a/src/lib/ext_stage_cache.c
+++ b/src/lib/ext_stage_cache.c
@@ -111,7 +111,7 @@ void stage_cache_get_raw(int stage_id, void **base, size_t *size)
}
*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 @@ void stage_cache_load_stage(int stage_id, struct prog *stage)
}
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 e19c03d0b7..be4a7867e2 100644
--- a/src/lib/imd.c
+++ b/src/lib/imd.c
@@ -288,8 +288,7 @@ static int imdr_limit_size(struct imdr *imdr, size_t max_size)
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 @@ void imd_handle_init_partial_recovery(struct imd *imd)
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 @@ int imd_recover(struct imd *imd)
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 @@ const struct imd_entry *imd_entry_find_or_add(const struct imd *imd,
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 @@ void *imd_entry_at(const struct imd *imd, const struct imd_entry *entry)
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 @@ static void imdr_print_entries(const struct imdr *imdr, const char *indent,
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 cb66c3b219..7638e0e578 100644
--- a/src/lib/imd_cbmem.c
+++ b/src/lib/imd_cbmem.c
@@ -178,7 +178,7 @@ int cbmem_entry_remove(const struct cbmem_entry *entry)
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 @@ void cbmem_add_records_to_cbtable(struct lb_header *header)
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 @@ void cbmem_add_records_to_cbtable(struct lb_header *header)
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;
}
}