Skip to content

Commit 1b50bb4

Browse files
pavelmachekjacek-anaszewski
authored andcommitted
Fix pattern handling optimalization
Check for zero duration before skipping step. This fixes pattern echo "0 1000 10 2550 0 1000" > pattern which should do [ .-xXx-.] but does [ Xx-.] Signed-off-by: Pavel Machek <pavel@ucw.cz> Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
1 parent 8dbac65 commit 1b50bb4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/leds/trigger/ledtrig-pattern.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ static void pattern_trig_timer_function(struct timer_list *t)
8787
data->curr->brightness);
8888
mod_timer(&data->timer,
8989
jiffies + msecs_to_jiffies(data->curr->delta_t));
90-
91-
/* Skip the tuple with zero duration */
92-
pattern_trig_update_patterns(data);
90+
if (!data->next->delta_t) {
91+
/* Skip the tuple with zero duration */
92+
pattern_trig_update_patterns(data);
93+
}
9394
/* Select next tuple */
9495
pattern_trig_update_patterns(data);
9596
} else {

0 commit comments

Comments
 (0)