From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Li Qiang <liq3ea@gmail.com>
Subject: [Qemu-devel] [PULL 1/3] usb: ohci: make num_ports to an unsinged integer
Date: Mon, 29 Oct 2018 21:02:48 +0100 [thread overview]
Message-ID: <20181029200250.24029-2-kraxel@redhat.com> (raw)
In-Reply-To: <20181029200250.24029-1-kraxel@redhat.com>
From: Li Qiang <liq3ea@gmail.com>
This can avoid setting OCHIState.num_ports to a negative num.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Message-id: 1540263618-18344-1-git-send-email-liq3ea@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/hcd-ohci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 66656a1133..c34cf5b73a 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -57,7 +57,7 @@ typedef struct {
qemu_irq irq;
MemoryRegion mem;
AddressSpace *as;
- int num_ports;
+ uint32_t num_ports;
const char *name;
QEMUTimer *eof_timer;
@@ -1850,7 +1850,7 @@ static USBBusOps ohci_bus_ops = {
};
static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
- int num_ports, dma_addr_t localmem_base,
+ uint32_t num_ports, dma_addr_t localmem_base,
char *masterbus, uint32_t firstport,
AddressSpace *as, Error **errp)
{
@@ -1860,7 +1860,7 @@ static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
ohci->as = as;
if (num_ports > OHCI_MAX_PORTS) {
- error_setg(errp, "OHCI num-ports=%d is too big (limit is %d ports)",
+ error_setg(errp, "OHCI num-ports=%u is too big (limit is %u ports)",
num_ports, OHCI_MAX_PORTS);
return;
}
--
2.9.3
next prev parent reply other threads:[~2018-10-29 20:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 20:02 [Qemu-devel] [PULL 0/3] Usb 20181029 patches Gerd Hoffmann
2018-10-29 20:02 ` Gerd Hoffmann [this message]
2018-10-29 20:02 ` [Qemu-devel] [PULL 2/3] hw: ccid-card-emulated: introduce clean_event_notifier Gerd Hoffmann
2018-10-29 20:02 ` [Qemu-devel] [PULL 3/3] hw: ccid-card-emulated: cleanup resource when realize in error path Gerd Hoffmann
2018-10-30 14:09 ` [Qemu-devel] [PULL 0/3] Usb 20181029 patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181029200250.24029-2-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=liq3ea@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).