From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Baolin Wang <baolin.wang@linaro.org>,
rteysseyre@gmail.com, bjorn.andersson@linaro.org,
broonie@kernel.org, linus.walleij@linaro.org,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix pattern handling optimalization
Date: Thu, 25 Oct 2018 21:17:45 +0200 [thread overview]
Message-ID: <79c29d20-ae6a-4a12-28fa-93d7305a0623@gmail.com> (raw)
In-Reply-To: <20181024204439.GA32300@amd>
Hi Pavel.
Thank you for the patch.
On 10/24/2018 10:44 PM, Pavel Machek wrote:
>
> 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>
>
>
> diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c
> index ce7acd1..bc5f495 100644
> --- a/drivers/leds/trigger/ledtrig-pattern.c
> +++ b/drivers/leds/trigger/ledtrig-pattern.c
> @@ -87,9 +87,10 @@ static void pattern_trig_timer_function(struct timer_list *t)
> data->curr->brightness);
> mod_timer(&data->timer,
> jiffies + msecs_to_jiffies(data->curr->delta_t));
> -
> - /* Skip the tuple with zero duration */
> - pattern_trig_update_patterns(data);
> + if (!data->next->delta_t) {
> + /* Skip the tuple with zero duration */
> + pattern_trig_update_patterns(data);
> + }
> /* Select next tuple */
> pattern_trig_update_patterns(data);
> } else {
>
Yep, it fixes the issue.
Applied to the fixes-for-4.20-rc2 branch of linux-leds.git
--
Best regards,
Jacek Anaszewski
next prev parent reply other threads:[~2018-10-25 19:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 4:07 [PATCH v15 1/2] leds: core: Introduce LED pattern trigger Baolin Wang
2018-10-11 4:07 ` [PATCH v15 2/2] leds: sc27xx: Add pattern_set/clear interfaces for LED controller Baolin Wang
2018-10-11 20:07 ` [PATCH v15 1/2] leds: core: Introduce LED pattern trigger Jacek Anaszewski
2018-10-12 1:40 ` Baolin Wang
2018-10-24 8:34 ` Pavel Machek
2018-10-24 8:31 ` Pavel Machek
2018-10-24 19:17 ` Jacek Anaszewski
2018-10-24 19:55 ` Pavel Machek
2018-10-24 20:44 ` [PATCH] Fix pattern handling optimalization Pavel Machek
2018-10-25 19:17 ` Jacek Anaszewski [this message]
2018-10-25 21:24 ` More checks for patterns? was: " Pavel Machek
2018-10-26 8:02 ` Baolin Wang
2018-10-26 19:56 ` Jacek Anaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=79c29d20-ae6a-4a12-28fa-93d7305a0623@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=baolin.wang@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=broonie@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rteysseyre@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).