public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/media/IR/ir-keytable.c: fix binary search
@ 2010-10-30 20:17 David Härdeman
  0 siblings, 0 replies; only message in thread
From: David Härdeman @ 2010-10-30 20:17 UTC (permalink / raw)
  To: torvalds; +Cc: jarod, dmitry.torokhov, linux-media, linux-kernel, mchehab

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>
---
 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;


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-10-30 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-30 20:17 [PATCH] drivers/media/IR/ir-keytable.c: fix binary search David Härdeman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox