Skip to content

Commit b43a8f0

Browse files
ukleinekpavelmachek
authored andcommitted
leds: pwm: simplify if condition
.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 <[email protected]> Tested-by: Jeff LaBundy <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent 64d7e23 commit b43a8f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/leds/leds-pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
102102
pwm_get_args(led_data->pwm, &pargs);
103103

104104
led_data->period = pargs.period;
105-
if (!led_data->period && (led->pwm_period_ns > 0))
105+
if (!led_data->period)
106106
led_data->period = led->pwm_period_ns;
107107

108108
ret = devm_led_classdev_register(dev, &led_data->cdev);

0 commit comments

Comments
 (0)