Thread (6 messages) 6 messages, 4 authors, 2012-09-24

Re: [PATCH 1/2] drivers gpio: Check for negativ gpio values

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2012-09-24 09:36:40

On 11:16 Mon 24 Sep     , Jan Lübbe wrote:
On Mon, 2012-09-24 at 10:59 +0200, Teresa Gámez wrote:
quoted
 static int gpio_is_valid(unsigned gpio)
 {
-	if (gpio < ARCH_NR_GPIOS)
+	if (gpio < ARCH_NR_GPIOS && gpio >= 0)
For an 'unsigned gpio', gpio >= 0 is always true.
unsigned is wrong type gpio need to int

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help