
From: Simon Glass <sjg@chromium.org> This function has the same name as the struct, which is confusing. Rename it to smbios_get_header() and update the function comment a little. Signed-off-by: Simon Glass <sjg@chromium.org> --- (no changes since v1) board/coreboot/coreboot/sysinfo.c | 4 ++-- include/smbios.h | 7 ++++--- lib/smbios-parser.c | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/board/coreboot/coreboot/sysinfo.c b/board/coreboot/coreboot/sysinfo.c index d6b19530023..5cf5cf3e286 100644 --- a/board/coreboot/coreboot/sysinfo.c +++ b/board/coreboot/coreboot/sysinfo.c @@ -62,8 +62,8 @@ static int cb_detect(struct udevice *dev) if (!smbios) return 0; - priv->bios = smbios_header(smbios, SMBIOS_BIOS_INFORMATION); - priv->system = smbios_header(smbios, SMBIOS_SYSTEM_INFORMATION); + priv->bios = smbios_get_header(smbios, SMBIOS_BIOS_INFORMATION); + priv->system = smbios_get_header(smbios, SMBIOS_SYSTEM_INFORMATION); priv->t0 = (struct smbios_type0 *)priv->bios; priv->t1 = (struct smbios_type1 *)priv->system; diff --git a/include/smbios.h b/include/smbios.h index b5fed57aba2..41e25bd31b3 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -325,13 +325,14 @@ ulong write_smbios_table(ulong addr); const struct smbios_entry *smbios_entry(u64 address, u32 size); /** - * smbios_header() - Search for SMBIOS header type + * smbios_get_header() - Search for an SMBIOS header type * - * @entry: pointer to a struct smbios_entry + * @entry: pointer to the first entry * @type: SMBIOS type * @return: NULL or a valid pointer to a struct smbios_header */ -const struct smbios_header *smbios_header(const struct smbios_entry *entry, int type); +const struct smbios_header * +smbios_get_header(const struct smbios_entry *entry, int type); /** * smbios_string() - Return string from SMBIOS diff --git a/lib/smbios-parser.c b/lib/smbios-parser.c index 9a62b3c760d..2db90d8235b 100644 --- a/lib/smbios-parser.c +++ b/lib/smbios-parser.c @@ -46,7 +46,8 @@ static struct smbios_header *get_next_header(const struct smbios_header *curr) return (struct smbios_header *)find_next_header(pos); } -const struct smbios_header *smbios_header(const struct smbios_entry *entry, int type) +const struct smbios_header *smbios_get_header(const struct smbios_entry *entry, + int type) { const unsigned int num_header = entry->struct_count; const struct smbios_header *header = (struct smbios_header *)((uintptr_t)entry->struct_table_address); @@ -98,7 +99,7 @@ int smbios_update_version_full(void *smbios_tab, const char *version) char *ptr; log_info("Updating SMBIOS table at %p\n", smbios_tab); - hdr = smbios_header(smbios_tab, SMBIOS_BIOS_INFORMATION); + hdr = smbios_get_header(smbios_tab, SMBIOS_BIOS_INFORMATION); if (!hdr) return log_msg_ret("tab", -ENOENT); bios = (struct smbios_type0 *)hdr; -- 2.43.0