Skip to content

Commit 9d7b89a

Browse files
LawstorantJiri Kosina
authored andcommitted
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>
1 parent 4e127a7 commit 9d7b89a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/hid/usbhid/hid-pidff.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,8 @@ static int pidff_request_effect_upload(struct pidff_device *pidff, int efnum)
806806

807807
static int pidff_needs_playback(struct pidff_device *pidff, int effect_id, int n)
808808
{
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;
811811
}
812812

813813
/*

0 commit comments

Comments
 (0)