Skip to content

Commit b9ebecc

Browse files
committed
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: 90d1323 ("dmioem: Decode HPE OEM Record 242") Cc: Jerry Hoemann <jerry.hoemann@hpe.com>
1 parent 189ca35 commit b9ebecc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dmioem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
12301230
if (!(opt.flags & FLAG_QUIET))
12311231
pr_attr("Associated Handle", "0x%04X", WORD(data + 0x4));
12321232
dmi_hp_242_hdd_type(data[0x06]);
1233-
pr_attr("ID", "%lx", QWORD(data + 0x07));
1233+
pr_attr("ID", "%llx", QWORD(data + 0x07));
12341234
if (h->length < 0x3E)
12351235
pr_attr("Capacity", "%u MB", DWORD(data + 0x0F));
12361236
else

0 commit comments

Comments
 (0)