aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/efi.c
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2015-04-30 15:23:05 +0200
committerMatt Fleming <matt.fleming@intel.com>2015-05-05 17:29:28 +0100
commitb119fe080a83d32d78f56877fe3a95a155417130 (patch)
tree50b61170192ec7659861810d2b5c6b8f09c43050 /drivers/firmware/efi/efi.c
parentefi/esrt: Fix some compiler warnings (diff)
downloadlinux-dev-b119fe080a83d32d78f56877fe3a95a155417130.tar.xz
linux-dev-b119fe080a83d32d78f56877fe3a95a155417130.zip
efi: dmi: List SMBIOS3 table before SMBIOS table
The SMBIOS3 table should appear before the SMBIOS table in /sys/firmware/efi/systab. This allows user-space utilities which support both to pick the SMBIOS3 table with a single pass on systems where both are implemented. The SMBIOS3 entry point is more capable than the SMBIOS entry point so it should be preferred. This follows the same logic as the ACPI20 table being listed before the ACPI table. Signed-off-by: Jean Delvare <jdelvare@suse.de> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers/firmware/efi/efi.c')
-rw-r--r--drivers/firmware/efi/efi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 48b4c356740f..ca617f40574a 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -86,10 +86,15 @@ static ssize_t systab_show(struct kobject *kobj,
str += sprintf(str, "ACPI20=0x%lx\n", efi.acpi20);
if (efi.acpi != EFI_INVALID_TABLE_ADDR)
str += sprintf(str, "ACPI=0x%lx\n", efi.acpi);
- if (efi.smbios != EFI_INVALID_TABLE_ADDR)
- str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
+ /*
+ * If both SMBIOS and SMBIOS3 entry points are implemented, the
+ * SMBIOS3 entry point shall be preferred, so we list it first to
+ * let applications stop parsing after the first match.
+ */
if (efi.smbios3 != EFI_INVALID_TABLE_ADDR)
str += sprintf(str, "SMBIOS3=0x%lx\n", efi.smbios3);
+ if (efi.smbios != EFI_INVALID_TABLE_ADDR)
+ str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
if (efi.hcdp != EFI_INVALID_TABLE_ADDR)
str += sprintf(str, "HCDP=0x%lx\n", efi.hcdp);
if (efi.boot_info != EFI_INVALID_TABLE_ADDR)