|
|
65c10b |
From b381d53c1199895aecccad543210ae1d40534493 Mon Sep 17 00:00:00 2001
|
|
|
65c10b |
From: Deomid rojer Ryabkov <rojer9@fb.com>
|
|
|
65c10b |
Date: Mon, 26 Aug 2019 14:20:15 +0200
|
|
|
65c10b |
Subject: [PATCH 06/11] Use larger units for memory device and BIOS size
|
|
|
65c10b |
|
|
|
65c10b |
So, 8 MB instead of 8192 kB, 8 GB instead of 8192 MB.
|
|
|
65c10b |
|
|
|
65c10b |
Same principle as in c43afb47fcba ("dmidecode: Use the most
|
|
|
65c10b |
appropriate unit for cache size") applied to more fields.
|
|
|
65c10b |
|
|
|
65c10b |
---
|
|
|
65c10b |
dmidecode.c | 13 ++++++++-----
|
|
|
65c10b |
1 file changed, 8 insertions(+), 5 deletions(-)
|
|
|
65c10b |
|
|
|
65c10b |
diff --git a/dmidecode.c b/dmidecode.c
|
|
|
65c10b |
index 9c1e9c4b0498..5372c38879b3 100644
|
|
|
65c10b |
--- a/dmidecode.c
|
|
|
65c10b |
+++ b/dmidecode.c
|
|
|
65c10b |
@@ -318,7 +318,10 @@ static void dmi_bios_rom_size(u8 code1, u16 code2)
|
|
|
65c10b |
};
|
|
|
65c10b |
|
|
|
65c10b |
if (code1 != 0xFF)
|
|
|
65c10b |
- printf(" %u kB", (code1 + 1) << 6);
|
|
|
65c10b |
+ {
|
|
|
65c10b |
+ u64 s = { .l = (code1 + 1) << 6 };
|
|
|
65c10b |
+ dmi_print_memory_size(s, 1);
|
|
|
65c10b |
+ }
|
|
|
65c10b |
else
|
|
|
65c10b |
printf(" %u %s", code2 & 0x3FFF, unit[code2 >> 14]);
|
|
|
65c10b |
}
|
|
|
65c10b |
@@ -2372,10 +2375,10 @@ static void dmi_memory_device_size(u16 code)
|
|
|
65c10b |
printf(" Unknown");
|
|
|
65c10b |
else
|
|
|
65c10b |
{
|
|
|
65c10b |
- if (code & 0x8000)
|
|
|
65c10b |
- printf(" %u kB", code & 0x7FFF);
|
|
|
65c10b |
- else
|
|
|
65c10b |
- printf(" %u MB", code);
|
|
|
65c10b |
+ u64 s = { .l = code & 0x7FFF };
|
|
|
65c10b |
+ if (!(code & 0x8000))
|
|
|
65c10b |
+ s.l <<= 10;
|
|
|
65c10b |
+ dmi_print_memory_size(s, 1);
|
|
|
65c10b |
}
|
|
|
65c10b |
}
|
|
|
65c10b |
|
|
|
65c10b |
--
|
|
|
65c10b |
2.17.1
|
|
|
65c10b |
|