aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-01-30 15:25:08 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-01-30 15:25:08 +0000
commit7a147bbabd24000cdb44163282e6d773de754d44 (patch)
treec30eb448e2013a7b0b231763d0b44413480d3473 /target/linux/ramips/files
parent9f3818d5e0e9dcdbae52ad8e5c4372c99ac99d5f (diff)
downloadupstream-7a147bbabd24000cdb44163282e6d773de754d44.tar.gz
upstream-7a147bbabd24000cdb44163282e6d773de754d44.tar.bz2
upstream-7a147bbabd24000cdb44163282e6d773de754d44.zip
ramips: sanitize return value of ramips_gpio_get
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19401 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files')
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/common/gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/ramips/files/arch/mips/ralink/common/gpio.c b/target/linux/ramips/files/arch/mips/ralink/common/gpio.c
index 3a1b038636..892f15b1ed 100644
--- a/target/linux/ramips/files/arch/mips/ralink/common/gpio.c
+++ b/target/linux/ramips/files/arch/mips/ralink/common/gpio.c
@@ -131,7 +131,7 @@ static int ramips_gpio_get(struct gpio_chip *chip, unsigned offset)
u32 t;
t = ramips_gpio_rr(rg, RAMIPS_GPIO_REG_DATA);
- return (t & (1 << offset));
+ return !!(t & (1 << offset));
}
static struct ramips_gpio_chip ramips_gpio_chip0 = {