aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2010-10-30 16:17:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-30 21:02:22 -0400
commit0d07025effd3da8b9c74f18448823175f4c63a73 (patch)
tree7482289716e68a4239e11603af4848fc798d7b3b /drivers
parent1792f17b7210280a3d7ff29da9614ba779cfcedb (diff)
drivers/media/IR/ir-keytable.c: fix binary search
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/IR/ir-keytable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 9186b45132e..647d52b1a1b 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -325,9 +325,9 @@ static int ir_setkeytable(struct ir_input_dev *ir_dev,
325static unsigned int ir_lookup_by_scancode(const struct ir_scancode_table *rc_tab, 325static unsigned int ir_lookup_by_scancode(const struct ir_scancode_table *rc_tab,
326 unsigned int scancode) 326 unsigned int scancode)
327{ 327{
328 unsigned int start = 0; 328 int start = 0;
329 unsigned int end = rc_tab->len - 1; 329 int end = rc_tab->len - 1;
330 unsigned int mid; 330 int mid;
331 331
332 while (start <= end) { 332 while (start <= end) {
333 mid = (start + end) / 2; 333 mid = (start + end) / 2;