diff options
author | dim <dim@FreeBSD.org> | 2013-04-13 21:21:13 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-13 21:21:13 +0000 |
commit | 6a5be05861061839894b4f8a1f31c03093684f2a (patch) | |
tree | 1b1dfdcf875c16318c2d61b2fa2d2f7dd55e03ec /sys/mips | |
parent | b9f17d62db67c67d9d2177347bc75b306530943b (diff) | |
download | FreeBSD-src-6a5be05861061839894b4f8a1f31c03093684f2a.zip FreeBSD-src-6a5be05861061839894b4f8a1f31c03093684f2a.tar.gz |
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 <loos.br@gmail.com>
PR: kern/177759
MFC after: 3 days
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/atheros/ar71xx_gpio.c | 4 | ||||
-rw-r--r-- | sys/mips/cavium/octeon_gpio.c | 4 | ||||
-rw-r--r-- | sys/mips/rt305x/rt305x_gpio.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/mips/atheros/ar71xx_gpio.c b/sys/mips/atheros/ar71xx_gpio.c index 23386e5..580208e 100644 --- a/sys/mips/atheros/ar71xx_gpio.c +++ b/sys/mips/atheros/ar71xx_gpio.c @@ -219,8 +219,8 @@ ar71xx_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) 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 */ diff --git a/sys/mips/cavium/octeon_gpio.c b/sys/mips/cavium/octeon_gpio.c index 96ce39c..788f0aa 100644 --- a/sys/mips/cavium/octeon_gpio.c +++ b/sys/mips/cavium/octeon_gpio.c @@ -219,8 +219,8 @@ octeon_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) 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 */ diff --git a/sys/mips/rt305x/rt305x_gpio.c b/sys/mips/rt305x/rt305x_gpio.c index a911b33..1d68518 100644 --- a/sys/mips/rt305x/rt305x_gpio.c +++ b/sys/mips/rt305x/rt305x_gpio.c @@ -242,8 +242,8 @@ rt305x_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) 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 */ |