From owner-svn-src-head@FreeBSD.ORG Sat Apr 13 21:21:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4B3C2E2B; Sat, 13 Apr 2013 21:21:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2EDE0149A; Sat, 13 Apr 2013 21:21:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3DLLFWB096190; Sat, 13 Apr 2013 21:21:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3DLLD8o096179; Sat, 13 Apr 2013 21:21:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304132121.r3DLLD8o096179@svn.freebsd.org> From: Dimitry Andric Date: Sat, 13 Apr 2013 21:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249449 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/xscale/ixp425 mips/atheros mips/cavium mips/rt305x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Apr 2013 21:21:15 -0000 Author: dim Date: Sat Apr 13 21:21:13 2013 New Revision: 249449 URL: http://svnweb.freebsd.org/changeset/base/249449 Log: Fix undefined behaviour in several gpio_pin_setflags() routines (under sys/arm and sys/mips), squelching the clang 3.3 warnings about this. Noticed by: tinderbox and many irate spectators Submitted by: Luiz Otavio O Souza PR: kern/177759 MFC after: 3 days Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/freescale/imx/imx51_gpio.c head/sys/arm/xscale/ixp425/avila_gpio.c head/sys/arm/xscale/ixp425/cambria_gpio.c head/sys/mips/atheros/ar71xx_gpio.c head/sys/mips/cavium/octeon_gpio.c head/sys/mips/rt305x/rt305x_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Sat Apr 13 21:17:43 2013 (r249448) +++ head/sys/arm/allwinner/a10_gpio.c Sat Apr 13 21:21:13 2013 (r249449) @@ -300,8 +300,8 @@ a10_gpio_pin_setflags(device_t dev, uint if (i >= sc->sc_gpio_npins) return (EINVAL); - /* Filter out unwanted flags. */ - if ((flags &= sc->sc_gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->sc_gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together. */ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sat Apr 13 21:17:43 2013 (r249448) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sat Apr 13 21:21:13 2013 (r249449) @@ -385,8 +385,8 @@ bcm_gpio_pin_setflags(device_t dev, uint if (bcm_gpio_pin_is_ro(sc, pin)) return (EINVAL); - /* Filter out unwanted flags. */ - if ((flags &= sc->sc_gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->sc_gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together. */ Modified: head/sys/arm/freescale/imx/imx51_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_gpio.c Sat Apr 13 21:17:43 2013 (r249448) +++ head/sys/arm/freescale/imx/imx51_gpio.c Sat Apr 13 21:21:13 2013 (r249449) @@ -261,8 +261,8 @@ imx51_gpio_pin_setflags(device_t dev, ui if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: head/sys/arm/xscale/ixp425/avila_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_gpio.c Sat Apr 13 21:17:43 2013 (r249448) +++ head/sys/arm/xscale/ixp425/avila_gpio.c Sat Apr 13 21:21:13 2013 (r249449) @@ -220,8 +220,8 @@ avila_gpio_pin_setflags(device_t dev, ui if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & mask)) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->sc_pins[pin].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->sc_pins[pin].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: head/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/cambria_gpio.c Sat Apr 13 21:17:43 2013 (r249448) +++ head/sys/arm/xscale/ixp425/cambria_gpio.c Sat Apr 13 21:21:13 2013 (r249449) @@ -317,8 +317,8 @@ cambria_gpio_pin_setflags(device_t dev, if (pin >= GPIO_PINS) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->sc_pins[pin].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->sc_pins[pin].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Sat Apr 13 21:17:43 2013 (r249448) +++ head/sys/mips/atheros/ar71xx_gpio.c Sat Apr 13 21:21:13 2013 (r249449) @@ -219,8 +219,8 @@ ar71xx_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: head/sys/mips/cavium/octeon_gpio.c ============================================================================== --- head/sys/mips/cavium/octeon_gpio.c Sat Apr 13 21:17:43 2013 (r249448) +++ head/sys/mips/cavium/octeon_gpio.c Sat Apr 13 21:21:13 2013 (r249449) @@ -219,8 +219,8 @@ octeon_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: head/sys/mips/rt305x/rt305x_gpio.c ============================================================================== --- head/sys/mips/rt305x/rt305x_gpio.c Sat Apr 13 21:17:43 2013 (r249448) +++ head/sys/mips/rt305x/rt305x_gpio.c Sat Apr 13 21:21:13 2013 (r249449) @@ -242,8 +242,8 @@ rt305x_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */