From patchwork Sat Oct 30 20:17:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RGF2aWQgSMODwqRyZGVtYW4=?= X-Patchwork-Id: 292532 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9UKHxVk019806 for ; Sat, 30 Oct 2010 20:17:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750939Ab0J3URt (ORCPT ); Sat, 30 Oct 2010 16:17:49 -0400 Received: from 1-1-12-13a.han.sth.bostream.se ([82.182.30.168]:60895 "EHLO palpatine.hardeman.nu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813Ab0J3URs (ORCPT ); Sat, 30 Oct 2010 16:17:48 -0400 Received: from basil.haag.hardeman.nu (host-88-217-225-61.customer.m-online.net [88.217.225.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by palpatine.hardeman.nu (Postfix) with ESMTPSA id D37C4F04; Sat, 30 Oct 2010 22:17:45 +0200 (CEST) Received: by basil.haag.hardeman.nu (Postfix, from userid 1000) id 39DC31A03EA; Sat, 30 Oct 2010 22:17:44 +0200 (CEST) Subject: [PATCH] drivers/media/IR/ir-keytable.c: fix binary search To: torvalds@linux-foundation.org From: David =?utf-8?b?SMOkcmRlbWFu?= Cc: jarod@wilsonet.com, dmitry.torokhov@gmail.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, mchehab@infradead.org Date: Sat, 30 Oct 2010 22:17:44 +0200 Message-ID: <20101030201744.2964.20624.stgit@localhost.localdomain> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 30 Oct 2010 20:18:00 +0000 (UTC) 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;