Skip to content

Commit

Permalink
[media] gpio-ir-recv: a couple signedness bugs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Mar 19, 2012
1 parent 23bfb5b commit 955b443
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/media/rc/gpio-ir-recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion include/media/gpio-ir-recv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 955b443

Please sign in to comment.