summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2023-03-10 15:13:32 +0100
committerJean Delvare <jdelvare@suse.de>2023-03-10 15:15:19 +0100
commitb9ebecc6391c4ad36ce0088b93ca8333c2f05ee7 (patch)
treebc1d31e18b5e4e36fd82381edd178d8ac12fb86c
parent189ca352e9341778c21e95c27817574b2876ede7 (diff)
downloaddmidecode-git-b9ebecc6391c4ad36ce0088b93ca8333c2f05ee7.tar.gz
dmioem: HPE type 242: Fix ID on 32-bit systems
I noticed that the reported ID is different when building dmidecode in 32-bit mode. The reason is that %lx isn't a valid format to print a 64-bit integer. It works by accident on 64-bit systems because types "long integer" and "long long integer" are the same there, but on 32-bit systems, only the latter can actually store a 64-bit value. Change the format to %llx so that it works on 32-bit systems too. Signed-off-by: Jean Delvare <jdelvare@suse.de> Fixes: 90d1323a8d14 ("dmioem: Decode HPE OEM Record 242") Cc: Jerry Hoemann <jerry.hoemann@hpe.com>
-rw-r--r--dmioem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dmioem.c b/dmioem.c
index 0b3d91c..dc4b857 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -1230,7 +1230,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
if (!(opt.flags & FLAG_QUIET))
pr_attr("Associated Handle", "0x%04X", WORD(data + 0x4));
dmi_hp_242_hdd_type(data[0x06]);
- pr_attr("ID", "%lx", QWORD(data + 0x07));
+ pr_attr("ID", "%llx", QWORD(data + 0x07));
if (h->length < 0x3E)
pr_attr("Capacity", "%u MB", DWORD(data + 0x0F));
else