diff options
author | dim <dim@FreeBSD.org> | 2016-09-07 19:21:52 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-09-07 19:21:52 +0000 |
commit | 83216cdbb72b65e649ebf7582ea72cb089229b41 (patch) | |
tree | 64c271e4fde095bd846b545cd0ac949f4ece97ea | |
parent | 5af3f0b5e8740ebbf55d49df9c23dc25ea3616c0 (diff) | |
download | FreeBSD-src-83216cdbb72b65e649ebf7582ea72cb089229b41.zip FreeBSD-src-83216cdbb72b65e649ebf7582ea72cb089229b41.tar.gz |
MFC r305388:
With clang 3.9.0, compiling uplcom results in the following warnings:
sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE (UT_READ | UT_VENDOR | UT_DEVICE)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value. Fix this by using uint8_t instead.
Reviewed by: imp, hselasky
Differential Revision: https://reviews.freebsd.org/D7776
-rw-r--r-- | sys/dev/usb/serial/uplcom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/serial/uplcom.c b/sys/dev/usb/serial/uplcom.c index c194cb7..704ee9e 100644 --- a/sys/dev/usb/serial/uplcom.c +++ b/sys/dev/usb/serial/uplcom.c @@ -166,7 +166,7 @@ struct uplcom_softc { /* prototypes */ static usb_error_t uplcom_reset(struct uplcom_softc *, struct usb_device *); -static usb_error_t uplcom_pl2303_do(struct usb_device *, int8_t, uint8_t, +static usb_error_t uplcom_pl2303_do(struct usb_device *, uint8_t, uint8_t, uint16_t, uint16_t, uint16_t); static int uplcom_pl2303_init(struct usb_device *, uint8_t); static void uplcom_free(struct ucom_softc *); @@ -513,7 +513,7 @@ uplcom_reset(struct uplcom_softc *sc, struct usb_device *udev) } static usb_error_t -uplcom_pl2303_do(struct usb_device *udev, int8_t req_type, uint8_t request, +uplcom_pl2303_do(struct usb_device *udev, uint8_t req_type, uint8_t request, uint16_t value, uint16_t index, uint16_t length) { struct usb_device_request req; |