Tools: Testbench: Avoid warning about fallthrough and fix return code

The build of testbench fails at /* fallthrough */ with xt-clang
build for MTL since warnings are treated in tesbench build as
errors. The re-arrange of default and 'h' fixes also return
of -EINVAL in default case for unknown option.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
Seppo Ingalsuo 2023-10-25 16:47:54 +03:00 committed by Liam Girdwood
parent 2006297ee2
commit 3f2096c6b9
1 changed files with 5 additions and 4 deletions

View File

@ -353,13 +353,14 @@ static int parse_input_args(int argc, char **argv, struct testbench_prm *tp)
break; break;
/* print usage */ /* print usage */
default:
fprintf(stderr, "unknown option %c\n", option);
ret = -EINVAL;
/* fallthrough */
case 'h': case 'h':
print_usage(argv[0]); print_usage(argv[0]);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
default:
fprintf(stderr, "unknown option %c\n", option);
print_usage(argv[0]);
ret = -EINVAL;
} }
if (ret < 0) if (ret < 0)