Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

HID: pidff: Fix needs_playback check

A small bug made it's way here when rewriting code to Linux quality.
Currently, if an effect is not infinite and a program requests it's
playback with the same number of loops, the play command won't be fired
and if an effect is infinite, the spam will continue.

We want every playback update for non-infinite effects and only some
for infinite (detecting when a program requests stop with 0 which will
be different than previous value which is usually 1 or 255).

Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>

authored by

Tomasz Pakuła and committed by
Jiri Kosina
9d7b89a1 4e127a74

+2 -2
+2 -2
drivers/hid/usbhid/hid-pidff.c
··· 806 806 807 807 static int pidff_needs_playback(struct pidff_device *pidff, int effect_id, int n) 808 808 { 809 - return pidff->effect[effect_id].is_infinite || 810 - pidff->effect[effect_id].loop_count != n; 809 + return !pidff->effect[effect_id].is_infinite || 810 + pidff->effect[effect_id].loop_count != n; 811 811 } 812 812 813 813 /*