summaryrefslogtreecommitdiff
path: root/target
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
commite2dde81ead5f2448344f39137a9a4f30fd7b841c (patch)
tree676a416b94e21476e019f82d5b52a2708f3ba580 /target
parentaf9f40e60d0d04ad5a4835d90e282dc1d5c533eb (diff)
downloadmtk-20170518-e2dde81ead5f2448344f39137a9a4f30fd7b841c.zip
mtk-20170518-e2dde81ead5f2448344f39137a9a4f30fd7b841c.tar.gz
mtk-20170518-e2dde81ead5f2448344f39137a9a4f30fd7b841c.tar.bz2
ramips: sanitize return value of ramips_gpio_get
SVN-Revision: 19401
Diffstat (limited to 'target')
-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 3a1b038..892f15b 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 = {