From: David Härdeman Date: Sat, 30 Oct 2010 20:17:44 +0000 (+0200) Subject: drivers/media/IR/ir-keytable.c: fix binary search X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d07025effd3da8b9c74f18448823175f4c63a73;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Dmitry Torokhov Signed-off-by: Linus Torvalds --- diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 9186b45132ed..647d52b1a1b7 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, 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;