ramips: sanitize return value of ramips_gpio_get
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 30 Jan 2010 15:25:08 +0000 (15:25 +0000)
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 30 Jan 2010 15:25:08 +0000 (15:25 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19401 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/ramips/files/arch/mips/ralink/common/gpio.c

index 3a1b038..892f15b 100644 (file)
@@ -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 = {
This page took 0.025189 seconds and 4 git commands to generate.