Skip to content

Commit 62f733b

Browse files
committed
cmd/led.c: Remove unnecessary check on 'cmd' value
We first check that if argc is less than 2 we return CMD_RET_USAGE. We then see if argc is greater than 2 and if so call get_led_cmd() to set 'cmd' and otherwise set it to LEDST_COUNT (which will always be positive as it's an enum with 0 already assigned). Therefore the test on if cmd is less than 0 will always be false and simply be omitted. Reported by clang-3.8. Signed-off-by: Tom Rini <[email protected]>
1 parent 9398b8c commit 62f733b

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

cmd/led.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ int do_led(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
9090
return list_leds();
9191

9292
cmd = argc > 2 ? get_led_cmd(argv[2]) : LEDST_COUNT;
93-
if (cmd < 0)
94-
return CMD_RET_USAGE;
9593
#ifdef CONFIG_LED_BLINK
9694
if (cmd == LEDST_BLINK) {
9795
if (argc < 4)

0 commit comments

Comments
 (0)