From 2e317c37268c349fa09346f3ab36a8be53a3d2c0 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Thu, 16 Apr 2015 12:44:02 -0700 Subject: [PATCH] firmware/ihex2fw.c: restore missing default in switch statement Commit 2b5343df5692 ("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: 2b5343df5692 ("ihex: add support for CS:IP/EIP records") Signed-off-by: Nicolas Iooss Cc: Mark Brown Cc: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- firmware/ihex2fw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/ihex2fw.c b/firmware/ihex2fw.c index cf38e159131a1..08d90e25abf01 100644 --- a/firmware/ihex2fw.c +++ b/firmware/ihex2fw.c @@ -86,6 +86,7 @@ int main(int argc, char **argv) case 'j': include_jump = 1; break; + default: return usage(); } } -- 2.39.5