Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
7579 commits behind the upstream repository.
  • Tom Rini's avatar
    62f733b3
    cmd/led.c: Remove unnecessary check on 'cmd' value · 62f733b3
    Tom Rini authored
    
    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: default avatarTom Rini <trini@konsulko.com>
    62f733b3
    History
    cmd/led.c: Remove unnecessary check on 'cmd' value
    Tom Rini authored
    
    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: default avatarTom Rini <trini@konsulko.com>
led.c 2.64 KiB