]> xenbits.xensource.com Git - osstest/seabios.git/commitdiff
smbios: smbios_major_version()/smbios_minor_version() helpers
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 10 Dec 2020 20:17:16 +0000 (15:17 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 18 Dec 2021 16:39:13 +0000 (11:39 -0500)
They new helpers will be useful when we start supporting SMBIOS
3.0 entry points.  Use the new helpers at display_uuid().

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

index d22ab64394b6564be9cbafc2e114578e8799aa7e..10eaa3697f8b9ad8aeb4b3e7206df111989b5610 100644 (file)
@@ -324,6 +324,24 @@ void *smbios_get_tables(u32 *length)
     return NULL;
 }
 
+static int
+smbios_major_version(void)
+{
+    if (SMBios21Addr)
+        return SMBios21Addr->smbios_major_version;
+    else
+        return 0;
+}
+
+static int
+smbios_minor_version(void)
+{
+    if (SMBios21Addr)
+        return SMBios21Addr->smbios_minor_version;
+    else
+        return 0;
+}
+
 void
 display_uuid(void)
 {
@@ -344,9 +362,9 @@ display_uuid(void)
              * the encoding, but we follow dmidecode and assume big-endian
              * encoding.
              */
-            if (SMBios21Addr->smbios_major_version > 2 ||
-                (SMBios21Addr->smbios_major_version == 2 &&
-                 SMBios21Addr->smbios_minor_version >= 6)) {
+            if (smbios_major_version() > 2 ||
+                (smbios_major_version() == 2 &&
+                 smbios_minor_version() >= 6)) {
                 printf("Machine UUID"
                        " %02x%02x%02x%02x"
                        "-%02x%02x"