summaryrefslogtreecommitdiff
path: root/dmidecode.c
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2021-01-15 17:20:22 +0100
committerJean Delvare <jdelvare@suse.de>2021-01-15 17:20:22 +0100
commit21f37e0f65d0f7536550ab7e7eb1cc38a077b54b (patch)
treea2cfe8c8fe99c18f2e70f49948432444ff751a0c /dmidecode.c
parent89efc6b9563a70da9f2a91c05455ba9e7b37e126 (diff)
downloaddmidecode-git-21f37e0f65d0f7536550ab7e7eb1cc38a077b54b.tar.gz
dmidecode: Fix format warnings
Use the appropriate format specifiers to make the compiler happy. This fixes support ticket #110421: https://savannah.nongnu.org/support/index.php?110421 Signed-off-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'dmidecode.c')
-rw-r--r--dmidecode.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/dmidecode.c b/dmidecode.c
index 344dce7..5a8e514 100644
--- a/dmidecode.c
+++ b/dmidecode.c
@@ -2174,7 +2174,7 @@ static void dmi_slot_peers(u8 n, const u8 *data)
for (i = 1; i <= n; i++, data += 5)
{
- sprintf(attr, "Peer Device %hu", i);
+ sprintf(attr, "Peer Device %hhu", (u8)i);
pr_attr(attr, "%04x:%02x:%02x.%x (Width %u)",
WORD(data), data[2], data[3] >> 3, data[3] & 0x07,
data[4]);
@@ -2240,7 +2240,7 @@ static void dmi_oem_strings(const struct dmi_header *h)
for (i = 1; i <= count; i++)
{
- sprintf(attr, "String %hu", i);
+ sprintf(attr, "String %hhu", (u8)i);
pr_attr(attr, "%s",dmi_string(h, i));
}
}
@@ -2258,7 +2258,7 @@ static void dmi_system_configuration_options(const struct dmi_header *h)
for (i = 1; i <= count; i++)
{
- sprintf(attr, "Option %hu", i);
+ sprintf(attr, "Option %hhu", (u8)i);
pr_attr(attr, "%s",dmi_string(h, i));
}
}
@@ -2442,10 +2442,10 @@ static void dmi_event_log_descriptors(u8 count, u8 len, const u8 *p)
{
if (len >= 0x02)
{
- sprintf(attr, "Descriptor %hu", i + 1);
+ sprintf(attr, "Descriptor %d", i + 1);
pr_attr(attr, "%s",
dmi_event_log_descriptor_type(p[i * len]));
- sprintf(attr, "Data Format %hu", i + 1);
+ sprintf(attr, "Data Format %d", i + 1);
pr_attr(attr, "%s",
dmi_event_log_descriptor_format(p[i * len + 1]));
}
@@ -3423,11 +3423,11 @@ static void dmi_memory_channel_devices(u8 count, const u8 *p)
for (i = 1; i <= count; i++)
{
- sprintf(attr, "Device %hu Load", i);
+ sprintf(attr, "Device %hhu Load", (u8)i);
pr_attr(attr, "%u", p[3 * i]);
if (!(opt.flags & FLAG_QUIET))
{
- sprintf(attr, "Device %hu Handle", i);
+ sprintf(attr, "Device %hhu Handle", (u8)i);
pr_attr(attr, "0x%04X", WORD(p + 3 * i + 1));
}
}