aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/debug
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2014-11-06 09:36:43 -0500
committerJason Wessel <jason.wessel@windriver.com>2014-11-11 10:31:51 -0500
commit04bb171e7aa99dee0c92e772e4f66f8d5c1b4081 (patch)
tree3458b0e17522270aaffcfd694988f6677d06ca3b /kernel/debug
parent42c884c10b775ce04f8aabe488820134625c893e (diff)
kdb: Use KDB_REPEAT_* values as flags
The actual values of KDB_REPEAT_* enum values and overall logic stayed the same, but we now treat the values as flags. This makes it possible to add other flags and combine them, plus makes the code a lot simpler and shorter. But functionality-wise, there should be no changes. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Cc: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'kernel/debug')
-rw-r--r--kernel/debug/kdb/kdb_main.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 070f1ff358d2..cbacae24a55a 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1008,20 +1008,13 @@ int kdb_parse(const char *cmdstr)
1008 if (result && ignore_errors && result > KDB_CMD_GO) 1008 if (result && ignore_errors && result > KDB_CMD_GO)
1009 result = 0; 1009 result = 0;
1010 KDB_STATE_CLEAR(CMD); 1010 KDB_STATE_CLEAR(CMD);
1011 switch (tp->cmd_flags) { 1011
1012 case KDB_REPEAT_NONE: 1012 if (tp->cmd_flags & KDB_REPEAT_WITH_ARGS)
1013 argc = 0; 1013 return result;
1014 if (argv[0]) 1014
1015 *(argv[0]) = '\0'; 1015 argc = tp->cmd_flags & KDB_REPEAT_NO_ARGS ? 1 : 0;
1016 break; 1016 if (argv[argc])
1017 case KDB_REPEAT_NO_ARGS: 1017 *(argv[argc]) = '\0';
1018 argc = 1;
1019 if (argv[1])
1020 *(argv[1]) = '\0';
1021 break;
1022 case KDB_REPEAT_WITH_ARGS:
1023 break;
1024 }
1025 return result; 1018 return result;
1026 } 1019 }
1027 1020