Commit
62f733b396cbe39315e9f28ea348300c6a72caa9
Exists in
smarc_8mq_lf_v2020.04
and in
19 other branches
8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, emb_lf_v2024.04, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0
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 <trini@konsulko.com>
Showing
1 changed file
with
0 additions
and
2 deletions
Side-by-side Diff
... |
... |
@@ -90,8 +90,6 @@ |
90
|
90 |
return list_leds(); |
91
|
91 |
|
92
|
92 |
cmd = argc > 2 ? get_led_cmd(argv[2]) : LEDST_COUNT; |
93
|
|
- if (cmd < 0) |
94
|
|
- return CMD_RET_USAGE; |
95
|
93 |
#ifdef CONFIG_LED_BLINK |
96
|
94 |
if (cmd == LEDST_BLINK) { |
97
|
95 |
if (argc < 4) |