From: David Härdeman Date: Fri, 2 Apr 2010 18:58:28 +0000 (-0300) Subject: V4L/DVB: drivers/media/IR - improve keytable code X-Git-Tag: v2.6.35-rc1~480^2~240 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3074c0a3f020766c05c1249a31212bff4a77bea;p=pandora-kernel.git V4L/DVB: drivers/media/IR - improve keytable code The attached patch rewrites much of the keytable code in drivers/media/IR/ir-keytable.c. The scancodes are now inserted into the array in sorted order which allows for a binary search on lookup. The code has also been shrunk by about 150 lines. In addition it fixes the following bugs: Any use of ir_seek_table() was racy. ir_dev->driver_name is leaked between ir_input_register() and ir_input_unregister(). ir_setkeycode() unconditionally does clear_bit() on dev->keybit when removing a mapping, but there might be another mapping with a different scancode and the same keycode. This version has been updated to incorporate patch feedback from Mauro Carvalho Chehab. [mchehab@redhat.com: Fix a conflict with RC keytable breakup patches and input changes] Signed-off-by: David Härdeman Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed