]> xenbits.xensource.com Git - seabios.git/commitdiff
smbios: Use smbios_get_tables()/smbios_next() at display_uuid()
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 10 Dec 2020 20:08:34 +0000 (15:08 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 18 Dec 2021 16:39:12 +0000 (11:39 -0500)
Make the code more generic, and not specific for SMBIOS 2.1 entry
points.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
src/fw/biostables.c

index 1adc694c96e92dd7a6b8a24f897781a32bb82c48..d22ab64394b6564be9cbafc2e114578e8799aa7e 100644 (file)
@@ -327,9 +327,11 @@ void *smbios_get_tables(u32 *length)
 void
 display_uuid(void)
 {
-    struct smbios_type_1 *tbl = smbios_21_next(SMBios21Addr, NULL);
+    u32 smbios_len = 0;
+    void *smbios_tables = smbios_get_tables(&smbios_len);
+    struct smbios_type_1 *tbl = smbios_next(smbios_tables, smbios_len, NULL);
     int minlen = offsetof(struct smbios_type_1, uuid) + sizeof(tbl->uuid);
-    for (; tbl; tbl = smbios_21_next(SMBios21Addr, tbl))
+    for (; tbl; tbl = smbios_next(smbios_tables, smbios_len, tbl))
         if (tbl->header.type == 1 && tbl->header.length >= minlen) {
             u8 *uuid = tbl->uuid;
             u8 empty_uuid[sizeof(tbl->uuid)] = { 0 };