kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [media] gpio-ir-recv: a couple signedness bugs
@ 2012-03-10  8:58 Dan Carpenter
  2012-03-11 19:50 ` Trilok Soni
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-03-10  8:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Ravi Kumar V; +Cc: linux-media, kernel-janitors

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>

diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
index 6744479..0d87545 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 61a7fbb..67797bf 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;
 };
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] [media] gpio-ir-recv: a couple signedness bugs
  2012-03-10  8:58 [patch] [media] gpio-ir-recv: a couple signedness bugs Dan Carpenter
@ 2012-03-11 19:50 ` Trilok Soni
  0 siblings, 0 replies; 2+ messages in thread
From: Trilok Soni @ 2012-03-11 19:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mauro Carvalho Chehab, Ravi Kumar V, linux-media, kernel-janitors,
	linux-arm-msm

Hi Dan,

On 3/10/2012 2:28 PM, Dan Carpenter wrote:
> 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>
>

Thanks.

Reviewed-by: Trilok Soni <tsoni@codeaurora.org>

---Trilok Soni

--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-11 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-10  8:58 [patch] [media] gpio-ir-recv: a couple signedness bugs Dan Carpenter
2012-03-11 19:50 ` Trilok Soni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).