Patch "leds: pwm: simplify if condition" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    leds: pwm: simplify if condition

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     leds-pwm-simplify-if-condition.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ba3a90803ceb1eb8684933e43a5d73f5a94e7a7e
Author: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>
Date:   Fri Jan 24 17:54:07 2020 +0100

    leds: pwm: simplify if condition
    
    [ Upstream commit b43a8f01fccbfdddbc7f9b2bbad11b7db3fda4e1 ]
    
    .pwm_period_ns is an unsigned integer. So when led->pwm_period_ns > 0
    is false, we now assign 0 to a value that is already 0, so it doesn't
    hurt and we can skip checking the actual value.
    
    Signed-off-by: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>
    Tested-by: Jeff LaBundy <jeff@xxxxxxxxxxx>
    Signed-off-by: Pavel Machek <pavel@xxxxxx>
    Stable-dep-of: 76fe464c8e64 ("leds: pwm: Don't disable the PWM when the LED should be off")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 5d3faae51d59e..dc5c6100a419f 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -117,7 +117,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
 	pwm_get_args(led_data->pwm, &pargs);
 
 	led_data->period = pargs.period;
-	if (!led_data->period && (led->pwm_period_ns > 0))
+	if (!led_data->period)
 		led_data->period = led->pwm_period_ns;
 
 	ret = led_classdev_register(dev, &led_data->cdev);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux