aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/dev-smartcard-reader.c
diff options
context:
space:
mode:
authorAlex Chen <alex.chen@huawei.com>2020-11-19 02:57:51 +0000
committerGerd Hoffmann <kraxel@redhat.com>2021-01-22 14:51:35 +0100
commit268c02424b0b8078c15acdf73edbdeeb0dd80808 (patch)
tree42abbf12e3863e8c0511593805f17373e87bc74e /hw/usb/dev-smartcard-reader.c
parenta3c27ea0344d3cc7295a5f0589d5514913ec1522 (diff)
hw/usb: Fix bad printf format specifiers
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int". Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Alex Chen <alex.chen@huawei.com> Message-id: 20201119025751.45750-1-alex.chen@huawei.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/dev-smartcard-reader.c')
-rw-r--r--hw/usb/dev-smartcard-reader.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index 946df9734a..80109fa551 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -945,7 +945,7 @@ static void ccid_on_apdu_from_guest(USBCCIDState *s, CCID_XferBlock *recv)
return;
}
len = le32_to_cpu(recv->hdr.dwLength);
- DPRINTF(s, 1, "%s: seq %d, len %d\n", __func__,
+ DPRINTF(s, 1, "%s: seq %d, len %u\n", __func__,
recv->hdr.bSeq, len);
ccid_add_pending_answer(s, (CCID_Header *)recv);
if (s->card && len <= BULK_OUT_DATA_SIZE) {
@@ -995,13 +995,13 @@ static void ccid_handle_bulk_out(USBCCIDState *s, USBPacket *p)
if ((s->bulk_out_pos - 10 < ccid_header->dwLength) &&
(p->iov.size == CCID_MAX_PACKET_SIZE)) {
DPRINTF(s, D_VERBOSE,
- "usb-ccid: bulk_in: expecting more packets (%d/%d)\n",
+ "usb-ccid: bulk_in: expecting more packets (%u/%u)\n",
s->bulk_out_pos - 10, ccid_header->dwLength);
return;
}
if (s->bulk_out_pos - 10 != ccid_header->dwLength) {
DPRINTF(s, 1,
- "usb-ccid: bulk_in: message size mismatch (got %d, expected %d)\n",
+ "usb-ccid: bulk_in: message size mismatch (got %u, expected %u)\n",
s->bulk_out_pos - 10, ccid_header->dwLength);
goto err;
}
@@ -1202,7 +1202,7 @@ void ccid_card_send_apdu_to_guest(CCIDCardState *card,
ccid_report_error_failed(s, ERROR_HW_ERROR);
return;
}
- DPRINTF(s, 1, "APDU returned to guest %d (answer seq %d, slot %d)\n",
+ DPRINTF(s, 1, "APDU returned to guest %u (answer seq %d, slot %d)\n",
len, answer->seq, answer->slot);
ccid_write_data_block_answer(s, apdu, len);
}