diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-03-10 04:58:18 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 15:45:01 -0300 |
commit | 955b44304afca143b82304fe421e990ec607834a (patch) | |
tree | f0046ed726b7c677d6d70d256c816573cb503932 | |
parent | 23bfb5be9f4c14937d70ed09f24a19d86df1951b (diff) | |
download | linux-3.10-955b44304afca143b82304fe421e990ec607834a.tar.gz linux-3.10-955b44304afca143b82304fe421e990ec607834a.tar.bz2 linux-3.10-955b44304afca143b82304fe421e990ec607834a.zip |
[media] gpio-ir-recv: a couple signedness bugs
There are couple places where we check unsigned values for negative. I
changed ->gpin_nr to signed because in gpio_ir_recv_probe() we do:
if (pdata->gpio_nr < 0)
return -EINVAL;
I also change gval to a signed int in gpio_ir_recv_irq() because that's
the type that gpio_get_value_cansleep() returns and we test for negative
returns.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Trilok Soni <tsoni@codeaurora.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/rc/gpio-ir-recv.c | 4 | ||||
-rw-r--r-- | include/media/gpio-ir-recv.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 6744479a538..0d875450c5c 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -26,14 +26,14 @@ struct gpio_rc_dev { struct rc_dev *rcdev; - unsigned int gpio_nr; + int gpio_nr; bool active_low; }; static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) { struct gpio_rc_dev *gpio_dev = dev_id; - unsigned int gval; + int gval; int rc = 0; enum raw_event_type type = IR_SPACE; diff --git a/include/media/gpio-ir-recv.h b/include/media/gpio-ir-recv.h index 61a7fbb4712..67797bf5d43 100644 --- a/include/media/gpio-ir-recv.h +++ b/include/media/gpio-ir-recv.h @@ -14,7 +14,7 @@ #define __GPIO_IR_RECV_H__ struct gpio_ir_recv_platform_data { - unsigned int gpio_nr; + int gpio_nr; bool active_low; }; |