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/arm/allwinner | |
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/arm/allwinner')
-rw-r--r-- | sys/arm/allwinner/a10_gpio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arm/allwinner/a10_gpio.c b/sys/arm/allwinner/a10_gpio.c index bc0d92a..0ccea4f 100644 --- a/sys/arm/allwinner/a10_gpio.c +++ b/sys/arm/allwinner/a10_gpio.c @@ -300,8 +300,8 @@ a10_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) 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. */ |