firmware/ihex2fw.c: restore missing default in switch statement
authorNicolas Iooss <nicolas.iooss_linux@m4x.org>
Thu, 16 Apr 2015 19:44:02 +0000 (12:44 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:06 +0000 (00:32 +0100)
commit d43698e8abb58a6ac47d16e0f47bb55f452e4fc4 upstream.

Commit 2473238eac95 ("ihex: add support for CS:IP/EIP records") removes
the "default:" statement in the switch block, making the "return
usage();" line dead code and ihex2fw silently ignoring unknown options.
Restore this statement.

This bug was found by building with HOSTCC=clang and adding
-Wunreachable-code-return to HOSTCFLAGS.

Fixes: 2473238eac95 ("ihex: add support for CS:IP/EIP records")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
firmware/ihex2fw.c

index cf38e15..08d90e2 100644 (file)
@@ -86,6 +86,7 @@ int main(int argc, char **argv)
                case 'j':
                        include_jump = 1;
                        break;
+               default:
                        return usage();
                }
        }