Commit 87283515f5fe66fa382fa7296cb0063acbf37338
1 parent
3f9b2b1f
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
Showing
2 changed files
with
5 additions
and
4 deletions
hw/ads7846.c
hw/usb-ohci.c
... | ... | @@ -739,7 +739,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed, |
739 | 739 | OHCI_CC_NOERROR); |
740 | 740 | OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_SIZE, 0); |
741 | 741 | } else { |
742 | - if (ret > len) { | |
742 | + if (ret > (ssize_t) len) { | |
743 | 743 | printf("usb-ohci: DataOverrun %d > %zu\n", ret, len); |
744 | 744 | OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC, |
745 | 745 | OHCI_CC_DATAOVERRUN); |
... | ... | @@ -865,7 +865,7 @@ static int ohci_service_td(OHCIState *ohci, struct ohci_ed *ed) |
865 | 865 | dprintf(" TD @ 0x%.8x %u bytes %s r=%d cbp=0x%.8x be=0x%.8x\n", |
866 | 866 | addr, len, str, flag_r, td.cbp, td.be); |
867 | 867 | |
868 | - if (len >= 0 && dir != OHCI_TD_DIR_IN) { | |
868 | + if (len > 0 && dir != OHCI_TD_DIR_IN) { | |
869 | 869 | dprintf(" data:"); |
870 | 870 | for (i = 0; i < len; i++) |
871 | 871 | printf(" %.2x", ohci->usb_buf[i]); |
... | ... | @@ -1062,7 +1062,8 @@ static void ohci_process_lists(OHCIState *ohci, int completion) |
1062 | 1062 | { |
1063 | 1063 | if ((ohci->ctl & OHCI_CTL_CLE) && (ohci->status & OHCI_STATUS_CLF)) { |
1064 | 1064 | if (ohci->ctrl_cur && ohci->ctrl_cur != ohci->ctrl_head) |
1065 | - dprintf("usb-ohci: head %x, cur %x\n", ohci->ctrl_head, ohci->ctrl_cur); | |
1065 | + dprintf("usb-ohci: head %x, cur %x\n", | |
1066 | + ohci->ctrl_head, ohci->ctrl_cur); | |
1066 | 1067 | if (!ohci_service_ed_list(ohci, ohci->ctrl_head, completion)) { |
1067 | 1068 | ohci->ctrl_cur = 0; |
1068 | 1069 | ohci->status &= ~OHCI_STATUS_CLF; | ... | ... |