summaryrefslogtreecommitdiffstats
path: root/hw/usb-ohci.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-13 22:52:54 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-13 22:52:54 +0000
commit87283515f5fe66fa382fa7296cb0063acbf37338 (patch)
treeed2259d81bbc20a8889ea9d5a9028a98889be0d2 /hw/usb-ohci.c
parent3f9b2b1f6358ec1a19bee6d8a9dd2c3faa81c293 (diff)
downloadhqemu-87283515f5fe66fa382fa7296cb0063acbf37338.zip
hqemu-87283515f5fe66fa382fa7296cb0063acbf37338.tar.gz
Fix signed/unsigned comparisons in OHCI host.
ADS7846 is partially compatible with TSC2046. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3635 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/usb-ohci.c')
-rw-r--r--hw/usb-ohci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index 287c45e..a85d38e 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -739,7 +739,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
OHCI_CC_NOERROR);
OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_SIZE, 0);
} else {
- if (ret > len) {
+ if (ret > (ssize_t) len) {
printf("usb-ohci: DataOverrun %d > %zu\n", ret, len);
OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
OHCI_CC_DATAOVERRUN);
@@ -865,7 +865,7 @@ static int ohci_service_td(OHCIState *ohci, struct ohci_ed *ed)
dprintf(" TD @ 0x%.8x %u bytes %s r=%d cbp=0x%.8x be=0x%.8x\n",
addr, len, str, flag_r, td.cbp, td.be);
- if (len >= 0 && dir != OHCI_TD_DIR_IN) {
+ if (len > 0 && dir != OHCI_TD_DIR_IN) {
dprintf(" data:");
for (i = 0; i < len; i++)
printf(" %.2x", ohci->usb_buf[i]);
@@ -1062,7 +1062,8 @@ static void ohci_process_lists(OHCIState *ohci, int completion)
{
if ((ohci->ctl & OHCI_CTL_CLE) && (ohci->status & OHCI_STATUS_CLF)) {
if (ohci->ctrl_cur && ohci->ctrl_cur != ohci->ctrl_head)
- dprintf("usb-ohci: head %x, cur %x\n", ohci->ctrl_head, ohci->ctrl_cur);
+ dprintf("usb-ohci: head %x, cur %x\n",
+ ohci->ctrl_head, ohci->ctrl_cur);
if (!ohci_service_ed_list(ohci, ohci->ctrl_head, completion)) {
ohci->ctrl_cur = 0;
ohci->status &= ~OHCI_STATUS_CLF;
OpenPOWER on IntegriCloud