From b9ebecc6391c4ad36ce0088b93ca8333c2f05ee7 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 10 Mar 2023 15:13:32 +0100 Subject: 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 Fixes: 90d1323a8d14 ("dmioem: Decode HPE OEM Record 242") Cc: Jerry Hoemann --- dmioem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dmioem.c') 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 -- cgit v1.2.1