提交 0d07025e 编写于 作者: D David Härdeman 提交者: 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: NDavid Härdeman <david@hardeman.nu>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1792f17b
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册