From owner-svn-src-stable@freebsd.org Wed Sep 7 19:02:50 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4192BCF662; Wed, 7 Sep 2016 19:02:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCCB67FD; Wed, 7 Sep 2016 19:02:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u87J2mVY029069; Wed, 7 Sep 2016 19:02:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u87J2meQ029066; Wed, 7 Sep 2016 19:02:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609071902.u87J2meQ029066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 7 Sep 2016 19:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305555 - in stable: 10/sys/dev/ppbus 11/sys/dev/ppbus 9/sys/dev/ppbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2016 19:02:50 -0000 Author: dim Date: Wed Sep 7 19:02:47 2016 New Revision: 305555 URL: https://svnweb.freebsd.org/changeset/base/305555 Log: 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 Modified: stable/10/sys/dev/ppbus/ppb_1284.c stable/10/sys/dev/ppbus/ppb_base.c stable/10/sys/dev/ppbus/ppbconf.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/ppbus/ppb_1284.c stable/11/sys/dev/ppbus/ppb_base.c stable/11/sys/dev/ppbus/ppbconf.h stable/9/sys/dev/ppbus/ppb_1284.c stable/9/sys/dev/ppbus/ppb_base.c stable/9/sys/dev/ppbus/ppbconf.h Directory Properties: stable/11/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/10/sys/dev/ppbus/ppb_1284.c ============================================================================== --- stable/10/sys/dev/ppbus/ppb_1284.c Wed Sep 7 18:53:46 2016 (r305554) +++ stable/10/sys/dev/ppbus/ppb_1284.c Wed Sep 7 19:02:47 2016 (r305555) @@ -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)); } Modified: stable/10/sys/dev/ppbus/ppb_base.c ============================================================================== --- stable/10/sys/dev/ppbus/ppb_base.c Wed Sep 7 18:53:46 2016 (r305554) +++ stable/10/sys/dev/ppbus/ppb_base.c Wed Sep 7 19:02:47 2016 (r305555) @@ -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); Modified: stable/10/sys/dev/ppbus/ppbconf.h ============================================================================== --- stable/10/sys/dev/ppbus/ppbconf.h Wed Sep 7 18:53:46 2016 (r305554) +++ stable/10/sys/dev/ppbus/ppbconf.h Wed Sep 7 19:02:47 2016 (r305555) @@ -263,7 +263,7 @@ extern void _ppb_assert_locked(device_t, 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);