From 9b477e07e00bc2d651784d7c82c2123f0bd7386b Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 12 Feb 2019 23:44:46 +0100 Subject: nfct: Drop dead code in nfct_timeout_parse_params() Due to the first switch() in that function, default case in second one is unreachable. Given that both of them contain the same cases but the first one merely acts as an invalid command barrier (adding no value to the second one), drop the first one to make invalid commands actually hit default case in the second switch(). Fixes: dd73ceecdbe87 ("nfct: Update syntax to specify command before subsystem") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/nfct-extensions/timeout.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/nfct-extensions/timeout.c b/src/nfct-extensions/timeout.c index 30f9464..31e91a6 100644 --- a/src/nfct-extensions/timeout.c +++ b/src/nfct-extensions/timeout.c @@ -54,20 +54,6 @@ nfct_timeout_parse_params(struct mnl_socket *nl, int argc, char *argv[], int cmd return -1; } - switch (cmd) { - case NFCT_CMD_LIST: - case NFCT_CMD_ADD: - case NFCT_CMD_DELETE: - case NFCT_CMD_GET: - case NFCT_CMD_FLUSH: - case NFCT_CMD_DEFAULT_SET: - case NFCT_CMD_DEFAULT_GET: - break; - default: - nfct_cmd_timeout_usage(argv); - return -1; - } - switch (cmd) { case NFCT_CMD_LIST: ret = nfct_cmd_timeout_list(nl, argc, argv); -- cgit v1.2.3