Commit 9d7b89a1 authored by Tomasz Pakuła's avatar Tomasz Pakuła Committed by Jiri Kosina
Browse files

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: default avatarTomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent 4e127a74
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ static int pidff_request_effect_upload(struct pidff_device *pidff, int efnum)

static int pidff_needs_playback(struct pidff_device *pidff, int effect_id, int n)
{
	return pidff->effect[effect_id].is_infinite ||
	return !pidff->effect[effect_id].is_infinite ||
		pidff->effect[effect_id].loop_count != n;
}