summaryrefslogtreecommitdiffstats
path: root/drivers/input/ff-memless.c
Commit message (Collapse)AuthorAgeFilesLines
* Input: ff-memless - fix signed to unsigned bit overflowJussi Kivilinna2009-05-071-1/+1
| | | | | | | | | | | | | | | | | | | When userspace sets effect->u.rumble.strong_magnitude to 0x8001 or larger, ml_combine_effects() would always return strong_magnitude 0xffff. Problem is that 'gain' is passed in as signed integer. Multiplying magnitude (__u16) with gain (int) causes magnitude read as signed and results negative value (with magnitude > 0x8000). This signed integer is then divided and value, still negative, converted to 32bit unsigned integer. Finally checking combine overflow min(new+old, 0xffff) gives out 0xffff. Fix is to simply change 'gain' to unsigned int. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Acked-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* input: replace spin_lock_bh with spin_lock_irqsave in ml_ff_playbackArjan van de Ven2008-11-301-2/+3
| | | | | | | | | | | | | | | ml_ff_playback() uses spin_(un)lock_bh. However this function is called with interrupts disabled from erase_effect() in drivers/input/ff-core.c:196. This is not permitted, and will result in a WARN_ON in the bottom half handling code. This patch changes this function to just use spin_lock_irqsave() instead, solving the problem and simplifying the locking logic. This was reported as entry #106559 in kerneloops.org Reported-by: kerneloops.org Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: use clamp_val() macro in ff-memless.cHarvey Harrison2008-05-161-2/+2
| | | | | | | | Replace two opencoded nested min/max macros with clamp_val(). Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* [PATCH] remove many unneeded #includes of sched.hTim Schmielau2007-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: add to kernel-api docbookRandy Dunlap2006-11-241-1/+1
| | | | | | | | Add input subsystem to kernel-api docbook. Enhance some function and parameter comments. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: unified force feedback support for memoryless devicesAnssi Hannula2006-07-191-0/+515
Consolidate core implementing memoryless devices in one module; added support for gain and envelopes and periodic => rumble conversion. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
OpenPOWER on IntegriCloud