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