drivers/media/IR/ir-keytable.c: fix binary search
authorDavid Härdeman <david@hardeman.nu>
Sat, 30 Oct 2010 20:17:44 +0000 (22:17 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 31 Oct 2010 01:02:22 +0000 (18:02 -0700)
The input-large-scancode patches changed the binary search in
drivers/media/IR/ir-keytable.c to use unsigned integers, but
signed integers are actually necessary for the algorithm to work.

Signed-off-by: David Härdeman <david@hardeman.nu>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/media/IR/ir-keytable.c

index 9186b45132ed8d14d9274b6d32315a460a8ba471..647d52b1a1b75d3a38390d3ec3c9588abca28ac2 100644 (file)
@@ -325,9 +325,9 @@ static int ir_setkeytable(struct ir_input_dev *ir_dev,
 static unsigned int ir_lookup_by_scancode(const struct ir_scancode_table *rc_tab,
                                          unsigned int scancode)
 {
-       unsigned int start = 0;
-       unsigned int end = rc_tab->len - 1;
-       unsigned int mid;
+       int start = 0;
+       int end = rc_tab->len - 1;
+       int mid;
 
        while (start <= end) {
                mid = (start + end) / 2;