From: Tom Rini Date: Wed, 10 May 2017 15:20:14 -0400 Subject: [U-Boot] [PATCH 4/8] cmd/led.c: Remove unnecessary check on 'cmd' value In-Reply-To: <1494444018-2748-1-git-send-email-trini@konsulko.com> References: <1494444018-2748-1-git-send-email-trini@konsulko.com> Message-ID: <1494444018-2748-4-git-send-email-trini@konsulko.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- cmd/led.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/led.c b/cmd/led.c index 84173f86f228..bdfb16c0e098 100644 --- a/cmd/led.c +++ b/cmd/led.c @@ -90,8 +90,6 @@ int do_led(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return list_leds(); cmd = argc > 2 ? get_led_cmd(argv[2]) : LEDST_COUNT; - if (cmd < 0) - return CMD_RET_USAGE; #ifdef CONFIG_LED_BLINK if (cmd == LEDST_BLINK) { if (argc < 4) -- 1.9.1