]> git.baikalelectronics.ru Git - kernel.git/commit
Input: ff-memless - another fix for signed to unsigned overflow
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 25 Dec 2009 05:44:19 +0000 (21:44 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 25 Dec 2009 05:54:09 +0000 (21:54 -0800)
commitacd2f897dbe163335e035feca4efb34cefca3aac
tree51adca3f94ca3a1a31d249faa9da8b6b0d3f8e6b
parent80adf2a55bc9938ae1138fbdbe81d5b1381824a2
Input: ff-memless - another fix for signed to unsigned overflow

The commit ae28c0b3fda949dc1dabebd44b119819a3c93927 changed 'gain' from
signed to unsigned to fix an issue with rumble effect calculation, however
it introduced problems when calculating constant effects. Having 'gain'
being unsigned int was an unfortunate choice since it dominates all
implicit type conversions causing everything to be treated as unsigned
int.

Let's change it back to signed int and simply add proper casts to rumble
effect calculations.

Reported-by: Gary Stein <lordcnidarian@gmail.com>
Acked-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/ff-memless.c