diff options
author | hselasky <hselasky@FreeBSD.org> | 2012-04-02 10:50:42 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2012-04-02 10:50:42 +0000 |
commit | 126953ccbe190fe51094d1ccefda3226d1e5140c (patch) | |
tree | 70a9d586e75b3d8e087069f07020564df44b0b99 /sys/dev/usb/storage | |
parent | 56216c3bc99342baf89a814301e85dffe7a62a9b (diff) | |
download | FreeBSD-src-126953ccbe190fe51094d1ccefda3226d1e5140c.zip FreeBSD-src-126953ccbe190fe51094d1ccefda3226d1e5140c.tar.gz |
Fix compiler warnings, mostly signed issues,
when USB modules are compiled with WARNS=9.
MFC after: 1 weeks
Diffstat (limited to 'sys/dev/usb/storage')
-rw-r--r-- | sys/dev/usb/storage/umass.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/storage/urio.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/storage/ustorage_fs.c | 40 |
3 files changed, 23 insertions, 23 deletions
diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c index a2248ea..596a5ef 100644 --- a/sys/dev/usb/storage/umass.c +++ b/sys/dev/usb/storage/umass.c @@ -1452,7 +1452,7 @@ umass_t_bbb_status_callback(struct usb_xfer *xfer, usb_error_t error) /* Zero missing parts of the CSW: */ - if (actlen < sizeof(sc->csw)) + if (actlen < (int)sizeof(sc->csw)) memset(&sc->csw, 0, sizeof(sc->csw)); pc = usbd_xfer_get_frame(xfer, 0); @@ -1961,7 +1961,7 @@ umass_t_cbi_status_callback(struct usb_xfer *xfer, usb_error_t error) switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (actlen < sizeof(sc->sbl)) { + if (actlen < (int)sizeof(sc->sbl)) { goto tr_setup; } pc = usbd_xfer_get_frame(xfer, 0); diff --git a/sys/dev/usb/storage/urio.c b/sys/dev/usb/storage/urio.c index e79ae87..39fcbe9 100644 --- a/sys/dev/usb/storage/urio.c +++ b/sys/dev/usb/storage/urio.c @@ -246,7 +246,7 @@ urio_attach(device_t dev) error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &urio_fifo_methods, &sc->sc_fifo, - device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, + device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (error) { goto detach; diff --git a/sys/dev/usb/storage/ustorage_fs.c b/sys/dev/usb/storage/ustorage_fs.c index dd6b413..c874999 100644 --- a/sys/dev/usb/storage/ustorage_fs.c +++ b/sys/dev/usb/storage/ustorage_fs.c @@ -967,7 +967,7 @@ ustorage_fs_verify(struct ustorage_fs_softc *sc) } /* XXX TODO: verify that data is readable */ done: - return (ustorage_fs_min_len(sc, 0, 0 - 1)); + return (ustorage_fs_min_len(sc, 0, -1U)); } /*------------------------------------------------------------------------* @@ -989,7 +989,7 @@ ustorage_fs_inquiry(struct ustorage_fs_softc *sc) memset(buf, 0, 36); buf[0] = 0x7f; /* Unsupported, no device - type */ - return (ustorage_fs_min_len(sc, 36, 0 - 1)); + return (ustorage_fs_min_len(sc, 36, -1U)); } memset(buf, 0, 8); /* Non - removable, direct - access device */ @@ -1008,7 +1008,7 @@ ustorage_fs_inquiry(struct ustorage_fs_softc *sc) #if (USTORAGE_QDATA_MAX < 36) #error "(USTORAGE_QDATA_MAX < 36)" #endif - return (ustorage_fs_min_len(sc, 36, 0 - 1)); + return (ustorage_fs_min_len(sc, 36, -1U)); } /*------------------------------------------------------------------------* @@ -1077,7 +1077,7 @@ ustorage_fs_request_sense(struct ustorage_fs_softc *sc) #if (USTORAGE_QDATA_MAX < 18) #error "(USTORAGE_QDATA_MAX < 18)" #endif - return (ustorage_fs_min_len(sc, 18, 0 - 1)); + return (ustorage_fs_min_len(sc, 18, -1U)); } /*------------------------------------------------------------------------* @@ -1108,7 +1108,7 @@ ustorage_fs_read_capacity(struct ustorage_fs_softc *sc) #if (USTORAGE_QDATA_MAX < 8) #error "(USTORAGE_QDATA_MAX < 8)" #endif - return (ustorage_fs_min_len(sc, 8, 0 - 1)); + return (ustorage_fs_min_len(sc, 8, -1U)); } /*------------------------------------------------------------------------* @@ -1215,7 +1215,7 @@ ustorage_fs_mode_sense(struct ustorage_fs_softc *sc) #if (USTORAGE_QDATA_MAX < 24) #error "(USTORAGE_QDATA_MAX < 24)" #endif - return (ustorage_fs_min_len(sc, len, 0 - 1)); + return (ustorage_fs_min_len(sc, len, -1U)); } /*------------------------------------------------------------------------* @@ -1305,7 +1305,7 @@ ustorage_fs_read_format_capacities(struct ustorage_fs_softc *sc) #if (USTORAGE_QDATA_MAX < 12) #error "(USTORAGE_QDATA_MAX < 12)" #endif - return (ustorage_fs_min_len(sc, 12, 0 - 1)); + return (ustorage_fs_min_len(sc, 12, -1U)); } /*------------------------------------------------------------------------* @@ -1618,7 +1618,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) switch (sc->sc_cmd_data[0]) { case SC_INQUIRY: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); if (error) { break; } @@ -1633,7 +1633,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) case SC_MODE_SELECT_6: sc->sc_transfer.cmd_dir = DIR_READ; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); if (error) { break; } @@ -1649,7 +1649,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) case SC_MODE_SELECT_10: sc->sc_transfer.cmd_dir = DIR_READ; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_cmd_data[7]), 0 - 1); + get_be16(&sc->sc_cmd_data[7]), -1U); if (error) { break; } @@ -1664,7 +1664,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) case SC_MODE_SENSE_6: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); if (error) { break; } @@ -1680,7 +1680,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) case SC_MODE_SENSE_10: sc->sc_transfer.cmd_dir = DIR_WRITE; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_cmd_data[7]), 0 - 1); + get_be16(&sc->sc_cmd_data[7]), -1U); if (error) { break; } @@ -1694,7 +1694,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) break; case SC_PREVENT_ALLOW_MEDIUM_REMOVAL: - error = ustorage_fs_min_len(sc, 0, 0 - 1); + error = ustorage_fs_min_len(sc, 0, -1U); if (error) { break; } @@ -1776,7 +1776,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) case SC_READ_FORMAT_CAPACITIES: sc->sc_transfer.cmd_dir = DIR_WRITE; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_cmd_data[7]), 0 - 1); + get_be16(&sc->sc_cmd_data[7]), -1U); if (error) { break; } @@ -1791,7 +1791,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) case SC_REQUEST_SENSE: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); if (error) { break; } @@ -1805,7 +1805,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) break; case SC_START_STOP_UNIT: - error = ustorage_fs_min_len(sc, 0, 0 - 1); + error = ustorage_fs_min_len(sc, 0, -1U); if (error) { break; } @@ -1819,7 +1819,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) break; case SC_SYNCHRONIZE_CACHE: - error = ustorage_fs_min_len(sc, 0, 0 - 1); + error = ustorage_fs_min_len(sc, 0, -1U); if (error) { break; } @@ -1833,7 +1833,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) break; case SC_TEST_UNIT_READY: - error = ustorage_fs_min_len(sc, 0, 0 - 1); + error = ustorage_fs_min_len(sc, 0, -1U); if (error) { break; } @@ -1846,7 +1846,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) * We support a minimal version: BytChk must be 0. */ case SC_VERIFY: - error = ustorage_fs_min_len(sc, 0, 0 - 1); + error = ustorage_fs_min_len(sc, 0, -1U); if (error) { break; } @@ -1928,7 +1928,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_softc *sc) /* Fallthrough */ default: - error = ustorage_fs_min_len(sc, 0, 0 - 1); + error = ustorage_fs_min_len(sc, 0, -1U); if (error) { break; } |