diff options
author | Jean Delvare <jdelvare@suse.de> | 2023-03-10 15:13:32 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2023-03-10 15:15:19 +0100 |
commit | b9ebecc6391c4ad36ce0088b93ca8333c2f05ee7 (patch) | |
tree | bc1d31e18b5e4e36fd82381edd178d8ac12fb86c | |
parent | 189ca352e9341778c21e95c27817574b2876ede7 (diff) | |
download | dmidecode-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |