From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 08:02:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C36D5106566C; Sat, 22 Sep 2012 08:02:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE7C08FC0A; Sat, 22 Sep 2012 08:02:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M82got022037; Sat, 22 Sep 2012 08:02:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M82guR022035; Sat, 22 Sep 2012 08:02:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209220802.q8M82guR022035@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 22 Sep 2012 08:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240806 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 08:02:42 -0000 Author: hselasky Date: Sat Sep 22 08:02:42 2012 New Revision: 240806 URL: http://svn.freebsd.org/changeset/base/240806 Log: Apply some more casting. Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Sat Sep 22 07:44:36 2012 (r240805) +++ head/sys/dev/usb/net/if_smsc.c Sat Sep 22 08:02:42 2012 (r240806) @@ -334,7 +334,7 @@ static int smsc_eeprom_read(struct smsc_softc *sc, uint16_t off, uint8_t *buf, uint16_t buflen) { usb_ticks_t start_ticks; - usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); int err; int locked; uint32_t val; @@ -365,8 +365,8 @@ smsc_eeprom_read(struct smsc_softc *sc, break; uether_pause(&sc->sc_ue, hz / 100); - } while ((ticks - start_ticks) < max_ticks); - + } while (((usb_ticks_t)(ticks - start_ticks)) < max_ticks); + if (val & (SMSC_EEPROM_CMD_BUSY | SMSC_EEPROM_CMD_TIMEOUT)) { smsc_warn_printf(sc, "eeprom command failed\n"); err = USB_ERR_IOERROR; @@ -1247,7 +1247,7 @@ smsc_phy_init(struct smsc_softc *sc) { int bmcr; usb_ticks_t start_ticks; - usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); SMSC_LOCK_ASSERT(sc, MA_OWNED); @@ -1260,7 +1260,7 @@ smsc_phy_init(struct smsc_softc *sc) bmcr = smsc_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); } while ((bmcr & MII_BMCR) && ((ticks - start_ticks) < max_ticks)); - if ((ticks - start_ticks) >= max_ticks) { + if (((usb_ticks_t)(ticks - start_ticks)) >= max_ticks) { smsc_err_printf(sc, "PHY reset timed-out"); return (EIO); }