]> git.baikalelectronics.ru Git - kernel.git/commit
V4L/DVB: IR/imon: remove dead IMON_KEY_RELEASE_OFFSET
authorJarod Wilson <jarod@redhat.com>
Tue, 4 May 2010 19:17:05 +0000 (16:17 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:59:17 +0000 (12:59 -0300)
commit80e011e2307a91c4413bf4992dfd4ff17d104897
treeb8d6fea2a5b183128e15ddfb21662a270d4904b5
parent03cba17a6365e10381a611b475002d50ff4d37e9
V4L/DVB: IR/imon: remove dead IMON_KEY_RELEASE_OFFSET

On Tue, May 04, 2010 at 06:06:41PM +0200, Dan Carpenter wrote:
> On Tue, May 04, 2010 at 10:03:18AM -0400, Jarod Wilson wrote:
> > @@ -1205,7 +1204,7 @@ static u32 imon_panel_key_lookup(u64 hw_code)
> >   if (imon_panel_key_table[i].hw_code == (code | 0xffee))
> >   break;
> >
> > - keycode = imon_panel_key_table[i % IMON_KEY_RELEASE_OFFSET].keycode;
> > + keycode = imon_panel_key_table[i].keycode;
> >
> >   return keycode;
> >  }
>
> There is still potentially a problem here because if we don't hit the
> break statement, then we're one past the end of the array.

D'oh. Okay, here's v2, should fix that buglet too.

This hack was used when the imon driver was using internal key lookup
routines, but became dead weight when the driver was converted to use
ir-core's key lookup routines. These bits simply didn't get removed,
drop 'em now.

Pointed out by Dan Carpenter.

v2: fix possible attempt to access beyond end of key table array,
also pointed out by Dan.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/IR/imon.c