lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <79c29d20-ae6a-4a12-28fa-93d7305a0623@gmail.com>
Date:   Thu, 25 Oct 2018 21:17:45 +0200
From:   Jacek Anaszewski <jacek.anaszewski@...il.com>
To:     Pavel Machek <pavel@....cz>
Cc:     Baolin Wang <baolin.wang@...aro.org>, rteysseyre@...il.com,
        bjorn.andersson@...aro.org, broonie@...nel.org,
        linus.walleij@...aro.org, linux-leds@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix pattern handling optimalization

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@....cz>
> Suggested-by: Jacek Anaszewski <jacek.anaszewski@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ