Skip to content

Commit

Permalink
drivers/media/IR/ir-keytable.c: fix binary search
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Härdeman authored and Linus Torvalds committed Oct 31, 2010
1 parent 1792f17 commit 0d07025
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/media/IR/ir-keytable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0d07025

Please sign in to comment.