|
|
38ce75 |
From 941591e24564e4c6d6584dbaa868976f9e80e925 Mon Sep 17 00:00:00 2001
|
|
|
38ce75 |
From: Jean Delvare <jdelvare@suse.de>
|
|
|
38ce75 |
Date: Tue, 15 Jan 2019 12:59:08 +0100
|
|
|
38ce75 |
Subject: [PATCH 3/4] dmidecode: Use dmi_cache_size_2 in dmi_cache_size
|
|
|
38ce75 |
|
|
|
38ce75 |
Redirect dmi_cache_size() to dmi_cache_size_2() so that the cache
|
|
|
38ce75 |
size is always reported using the most appropriate unit, even if the
|
|
|
38ce75 |
BIOS does not populate the 32-bit cache size fields.
|
|
|
38ce75 |
|
|
|
38ce75 |
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
38ce75 |
Acked-by: Neil Horman <nhorman@tuxdriver.com>
|
|
|
38ce75 |
---
|
|
|
38ce75 |
dmidecode.c | 13 +++++--------
|
|
|
38ce75 |
1 file changed, 5 insertions(+), 8 deletions(-)
|
|
|
38ce75 |
|
|
|
38ce75 |
diff --git a/dmidecode.c b/dmidecode.c
|
|
|
38ce75 |
index 162e0c5..903ef35 100644
|
|
|
38ce75 |
--- a/dmidecode.c
|
|
|
38ce75 |
+++ b/dmidecode.c
|
|
|
38ce75 |
@@ -1550,14 +1550,6 @@ static const char *dmi_cache_location(u8 code)
|
|
|
38ce75 |
return location[code];
|
|
|
38ce75 |
}
|
|
|
38ce75 |
|
|
|
38ce75 |
-static void dmi_cache_size(u16 code)
|
|
|
38ce75 |
-{
|
|
|
38ce75 |
- if (code & 0x8000)
|
|
|
38ce75 |
- printf(" %u kB", (code & 0x7FFF) << 6);
|
|
|
38ce75 |
- else
|
|
|
38ce75 |
- printf(" %u kB", code);
|
|
|
38ce75 |
-}
|
|
|
38ce75 |
-
|
|
|
38ce75 |
static void dmi_cache_size_2(u32 code)
|
|
|
38ce75 |
{
|
|
|
38ce75 |
u64 size;
|
|
|
38ce75 |
@@ -1578,6 +1570,11 @@ static void dmi_cache_size_2(u32 code)
|
|
|
38ce75 |
dmi_print_memory_size(size, 1);
|
|
|
38ce75 |
}
|
|
|
38ce75 |
|
|
|
38ce75 |
+static void dmi_cache_size(u16 code)
|
|
|
38ce75 |
+{
|
|
|
38ce75 |
+ dmi_cache_size_2((((u32)code & 0x8000LU) << 16) | (code & 0x7FFFLU));
|
|
|
38ce75 |
+}
|
|
|
38ce75 |
+
|
|
|
38ce75 |
static void dmi_cache_types(u16 code, const char *sep)
|
|
|
38ce75 |
{
|
|
|
38ce75 |
/* 7.8.2 */
|
|
|
38ce75 |
--
|
|
|
38ce75 |
2.17.1
|
|
|
38ce75 |
|