[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20101030201744.2964.20624.stgit@localhost.localdomain>
Date: Sat, 30 Oct 2010 22:17:44 +0200
From: David Härdeman <david@...deman.nu>
To: torvalds@...ux-foundation.org
Cc: jarod@...sonet.com, dmitry.torokhov@...il.com,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
mchehab@...radead.org
Subject: [PATCH] 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@...deman.nu>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>
---
drivers/media/IR/ir-keytable.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 9186b45..647d52b 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists