summaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-09-05 11:55:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-12 12:01:49 +0200
commit679b989d095a617326bf8d84545a865f3f139861 (patch)
treeb511085844ed153d7c4be4bae2a16d1700af016f /commands
parent2628c8a8e1eee3cf6727c0c8a99ff5eec8ba4d1e (diff)
downloadbarebox-679b989d095a617326bf8d84545a865f3f139861.tar.gz
commands: trigger: drop unused variable
Static analyzer correctly identifies led as being set, but always overwritten later on. As the later assignments all have their own argument count check, so we can just drop the first assignment. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220905095557.596891-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/trigger.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/commands/trigger.c b/commands/trigger.c
index c1402b66f0..d2802080b9 100644
--- a/commands/trigger.c
+++ b/commands/trigger.c
@@ -16,7 +16,7 @@
static int do_trigger(int argc, char *argv[])
{
- struct led *led = NULL;
+ struct led *led;
int opt, ret = 0;
int cmd = LED_COMMAND_SHOW_INFO;
enum led_trigger trigger;
@@ -35,9 +35,6 @@ static int do_trigger(int argc, char *argv[])
}
}
- if (optind < argc)
- led = led_by_name_or_number(argv[optind]);
-
switch (cmd) {
case LED_COMMAND_SHOW_INFO:
led_triggers_show_info();