From 268c02424b0b8078c15acdf73edbdeeb0dd80808 Mon Sep 17 00:00:00 2001 From: Alex Chen Date: Thu, 19 Nov 2020 02:57:51 +0000 Subject: 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 Signed-off-by: Alex Chen Message-id: 20201119025751.45750-1-alex.chen@huawei.com Signed-off-by: Gerd Hoffmann --- hw/usb/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/usb/core.c') 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; -- cgit 1.4.1