Skip to content

Commit

Permalink
leds: trigger: remove redundant assignment to variable ret
Browse files Browse the repository at this point in the history
The variable ret is being assigned with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
  • Loading branch information
Colin Ian King authored and Pavel Machek committed Apr 27, 2020
1 parent 9af512e commit c85c7cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/leds/trigger/ledtrig-timer.c
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ static ssize_t led_delay_on_store(struct device *dev,
{
struct led_classdev *led_cdev = led_trigger_get_led(dev);
unsigned long state;
ssize_t ret = -EINVAL;
ssize_t ret;

ret = kstrtoul(buf, 10, &state);
if (ret)
@@ -53,7 +53,7 @@ static ssize_t led_delay_off_store(struct device *dev,
{
struct led_classdev *led_cdev = led_trigger_get_led(dev);
unsigned long state;
ssize_t ret = -EINVAL;
ssize_t ret;

ret = kstrtoul(buf, 10, &state);
if (ret)

0 comments on commit c85c7cd

Please sign in to comment.