usb: ohci: make num_ports to an unsinged integer
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>
This commit is contained in:
parent
b312532fd0
commit
b9a3a4f206
|
@ -57,7 +57,7 @@ typedef struct {
|
||||||
qemu_irq irq;
|
qemu_irq irq;
|
||||||
MemoryRegion mem;
|
MemoryRegion mem;
|
||||||
AddressSpace *as;
|
AddressSpace *as;
|
||||||
int num_ports;
|
uint32_t num_ports;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
QEMUTimer *eof_timer;
|
QEMUTimer *eof_timer;
|
||||||
|
@ -1850,7 +1850,7 @@ static USBBusOps ohci_bus_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
|
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,
|
char *masterbus, uint32_t firstport,
|
||||||
AddressSpace *as, Error **errp)
|
AddressSpace *as, Error **errp)
|
||||||
{
|
{
|
||||||
|
@ -1860,7 +1860,7 @@ static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
|
||||||
ohci->as = as;
|
ohci->as = as;
|
||||||
|
|
||||||
if (num_ports > OHCI_MAX_PORTS) {
|
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);
|
num_ports, OHCI_MAX_PORTS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue