aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/core.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/core.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/core.c')
-rw-r--r--hw/usb/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/usb/core.c b/hw/usb/core.c
index e960036f4d..c895522a1d 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -142,7 +142,7 @@ static void do_token_setup(USBDevice *s, USBPacket *p)
setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
if (setup_len > sizeof(s->data_buf)) {
fprintf(stderr,
- "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
+ "usb_generic_handle_packet: ctrl buffer too small (%u > %zu)\n",
setup_len, sizeof(s->data_buf));
p->status = USB_RET_STALL;
return;
@@ -277,7 +277,7 @@ static void do_parameter(USBDevice *s, USBPacket *p)
setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
if (setup_len > sizeof(s->data_buf)) {
fprintf(stderr,
- "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
+ "usb_generic_handle_packet: ctrl buffer too small (%u > %zu)\n",
setup_len, sizeof(s->data_buf));
p->status = USB_RET_STALL;
return;