aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-01-31 23:34:46 +0100
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-02-02 19:57:45 +0100
commit551bc96be51c183ee90770bec985990bc6bcc4ad (patch)
treef2d5105e595a43993a16e428b81c7e41c66cbb4a
parent5778c88eb094079502acad632febde7ff0d5b146 (diff)
downloadu-boot-551bc96be51c183ee90770bec985990bc6bcc4ad.zip
u-boot-551bc96be51c183ee90770bec985990bc6bcc4ad.tar.gz
u-boot-551bc96be51c183ee90770bec985990bc6bcc4ad.tar.bz2
cmd: smbios: show correct table size for SMBIOS2.1 entry point
The SMBIOS table size for SMBIOS2.1 entry points is in field 'Structure Table Length' (offset 0x16) and not in field 'Maximum Structure Size' (offset 0x08). Rename the receiving variable max_struct_size to table_maximum_size to avoid future confusion. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-rw-r--r--cmd/smbios.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/smbios.c b/cmd/smbios.c
index 95bdff6..e2d82be 100644
--- a/cmd/smbios.c
+++ b/cmd/smbios.c
@@ -126,7 +126,7 @@ static int do_smbios(struct cmd_tbl *cmdtp, int flag, int argc,
static const char smbios_sig[] = "_SM_";
static const char smbios3_sig[] = "_SM3_";
size_t count = 0;
- u32 max_struct_size;
+ u32 table_maximum_size;
addr = gd_smbios_start();
if (!addr) {
@@ -142,7 +142,7 @@ static int do_smbios(struct cmd_tbl *cmdtp, int flag, int argc,
entry3->major_ver, entry3->minor_ver, entry3->doc_rev);
table = (void *)(uintptr_t)entry3->struct_table_address;
size = entry3->length;
- max_struct_size = entry3->max_struct_size;
+ table_maximum_size = entry3->max_struct_size;
} else if (!memcmp(entry, smbios_sig, sizeof(smbios_sig) - 1)) {
struct smbios_entry *entry2 = entry;
@@ -150,7 +150,7 @@ static int do_smbios(struct cmd_tbl *cmdtp, int flag, int argc,
entry2->major_ver, entry2->minor_ver);
table = (void *)(uintptr_t)entry2->struct_table_address;
size = entry2->length;
- max_struct_size = entry2->max_struct_size;
+ table_maximum_size = entry2->struct_table_length;
} else {
log_err("Unknown SMBIOS anchor format\n");
return CMD_RET_FAILURE;
@@ -163,7 +163,7 @@ static int do_smbios(struct cmd_tbl *cmdtp, int flag, int argc,
for (struct smbios_header *pos = table; pos; pos = next_table(pos))
++count;
- printf("%zd structures occupying %d bytes\n", count, max_struct_size);
+ printf("%zd structures occupying %d bytes\n", count, table_maximum_size);
printf("Table at 0x%llx\n", (unsigned long long)map_to_sysmem(table));
for (struct smbios_header *pos = table; pos; pos = next_table(pos)) {