]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r305388:
authordim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 7 Sep 2016 19:21:52 +0000 (19:21 +0000)
committerdim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 7 Sep 2016 19:21:52 +0000 (19:21 +0000)
commit1a6de444974d4496a6a08316147124378473cccf
tree9faa61ea97f58d3eda5bc11815266316790e7a0a
parentc59d9ff8913c75c910594032ec6f46712bc359b2
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

git-svn-id: svn://svn.freebsd.org/base/stable/9@305557 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/usb/serial/uplcom.c