Commit 0d07025e authored by David Härdeman's avatar David Härdeman Committed by Linus Torvalds

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: default avatarDavid Härdeman <david@hardeman.nu>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1792f17b
...@@ -325,9 +325,9 @@ static int ir_setkeytable(struct ir_input_dev *ir_dev, ...@@ -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, static unsigned int ir_lookup_by_scancode(const struct ir_scancode_table *rc_tab,
unsigned int scancode) unsigned int scancode)
{ {
unsigned int start = 0; int start = 0;
unsigned int end = rc_tab->len - 1; int end = rc_tab->len - 1;
unsigned int mid; int mid;
while (start <= end) { while (start <= end) {
mid = (start + end) / 2; mid = (start + end) / 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment