In case of BE the dmi version can be displayed like 8.2 instead of 2.8. This patch correct it.
Signed-off-by: Ivan Khoronzhuk ivan.khoronzhuk@linaro.org --- drivers/firmware/dmi_scan.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index c5f7b4e..657ae0c 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -469,6 +469,7 @@ static void __init dmi_format_ids(char *buf, size_t len) */ static int __init dmi_present(const u8 *buf) { + const u8 *dbuf; int smbios_ver;
if (memcmp(buf, "_SM_", 4) == 0 && @@ -492,23 +493,23 @@ static int __init dmi_present(const u8 *buf) smbios_ver = 0; }
- buf += 16; + dbuf = buf + 16;
- if (memcmp(buf, "_DMI_", 5) == 0 && dmi_checksum(buf, 15)) { - dmi_num = get_unaligned_le16(buf + 12); - dmi_len = get_unaligned_le16(buf + 6); - dmi_base = get_unaligned_le32(buf + 8); + if (memcmp(dbuf, "_DMI_", 5) == 0 && dmi_checksum(dbuf, 15)) { + dmi_num = get_unaligned_le16(dbuf + 12); + dmi_len = get_unaligned_le16(dbuf + 6); + dmi_base = get_unaligned_le32(dbuf + 8);
if (dmi_walk_early(dmi_decode) == 0) { if (smbios_ver) { dmi_ver = smbios_ver; pr_info("SMBIOS %d.%d present.\n", - dmi_ver >> 8, dmi_ver & 0xFF); + buf[6], buf[7]); } else { - dmi_ver = (buf[14] & 0xF0) << 4 | - (buf[14] & 0x0F); + dmi_ver = (dbuf[14] & 0xF0) << 4 | + (dbuf[14] & 0x0F); pr_info("Legacy DMI %d.%d present.\n", - dmi_ver >> 8, dmi_ver & 0xFF); + dbuf[14] >> 4, dbuf[14] & 0x0F); } dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string)); printk(KERN_DEBUG "DMI: %s\n", dmi_ids_string); @@ -544,8 +545,7 @@ static int __init dmi_smbios3_present(const u8 *buf) dmi_num = dmi_len / 4;
if (dmi_walk_early(dmi_decode) == 0) { - pr_info("SMBIOS %d.%d present.\n", - dmi_ver >> 8, dmi_ver & 0xFF); + pr_info("SMBIOS %d.%d present.\n", buf[7], buf[8]); dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string)); pr_debug("DMI: %s\n", dmi_ids_string); return 0;