summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-09-07 19:02:47 +0000
committerdim <dim@FreeBSD.org>2016-09-07 19:02:47 +0000
commit69478467da704cf56025f7ecec912611ab1e4e71 (patch)
tree8fd2710a9fdf2905fa722344c12dc2f4a1c3674f /sys/dev/ppbus
parent3596d46a9c08dc81a1401fd8e9b7de8aaf2648c3 (diff)
downloadFreeBSD-src-69478467da704cf56025f7ecec912611ab1e4e71.zip
FreeBSD-src-69478467da704cf56025f7ecec912611ab1e4e71.tar.gz
MFC r305345:
With clang 3.9.0, compiling ppbus(4) results in the following warnings: sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int' to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion] if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) { ~~~~~~~~~~~~~~~~~~ ~~~~~~~^~~~~~~ sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int' to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion] if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY, ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int' to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion] nACK | SELECT | PERROR | nBUSY)) { ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ This is because nBUSY is 0x80, so the plain char argument is wrapped to a negative value. Fix this in a minimal fashion, by using uint8_t in a few places. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D7771
Diffstat (limited to 'sys/dev/ppbus')
-rw-r--r--sys/dev/ppbus/ppb_1284.c4
-rw-r--r--sys/dev/ppbus/ppb_base.c6
-rw-r--r--sys/dev/ppbus/ppbconf.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ppbus/ppb_1284.c b/sys/dev/ppbus/ppb_1284.c
index 31f38ce..5e86977 100644
--- a/sys/dev/ppbus/ppb_1284.c
+++ b/sys/dev/ppbus/ppb_1284.c
@@ -57,13 +57,13 @@ __FBSDID("$FreeBSD$");
* Wait for the peripherial up to 40ms
*/
static int
-do_1284_wait(device_t bus, char mask, char status)
+do_1284_wait(device_t bus, uint8_t mask, uint8_t status)
{
return (ppb_poll_bus(bus, 4, mask, status, PPB_NOINTR | PPB_POLL));
}
static int
-do_peripheral_wait(device_t bus, char mask, char status)
+do_peripheral_wait(device_t bus, uint8_t mask, uint8_t status)
{
return (ppb_poll_bus(bus, 100, mask, status, PPB_NOINTR | PPB_POLL));
}
diff --git a/sys/dev/ppbus/ppb_base.c b/sys/dev/ppbus/ppb_base.c
index 256d7a4..b87b597 100644
--- a/sys/dev/ppbus/ppb_base.c
+++ b/sys/dev/ppbus/ppb_base.c
@@ -54,11 +54,11 @@ MODULE_VERSION(ppbus, 1);
*/
int
ppb_poll_bus(device_t bus, int max,
- char mask, char status, int how)
+ uint8_t mask, uint8_t status, int how)
{
struct ppb_data *ppb = DEVTOSOFTC(bus);
int i, j, error;
- char r;
+ uint8_t r;
ppb_assert_locked(bus);
@@ -186,7 +186,7 @@ ppb_ecp_sync(device_t bus)
int
ppb_get_status(device_t bus, struct ppb_status *status)
{
- register char r;
+ uint8_t r;
ppb_assert_locked(bus);
diff --git a/sys/dev/ppbus/ppbconf.h b/sys/dev/ppbus/ppbconf.h
index c898482..8ac578e 100644
--- a/sys/dev/ppbus/ppbconf.h
+++ b/sys/dev/ppbus/ppbconf.h
@@ -263,7 +263,7 @@ extern void _ppb_assert_locked(device_t, const char *, int);
extern void ppb_init_callout(device_t, struct callout *, int);
extern int ppb_sleep(device_t, void *, int, const char *, int);
extern int ppb_get_status(device_t, struct ppb_status *);
-extern int ppb_poll_bus(device_t, int, char, char, int);
+extern int ppb_poll_bus(device_t, int, uint8_t, uint8_t, int);
extern int ppb_reset_epp_timeout(device_t);
extern int ppb_ecp_sync(device_t);
extern int ppb_get_epp_protocol(device_t);
OpenPOWER on IntegriCloud