diff mbox

[RFC,v2,09/10] kdb: Improve usability of help text when running in kiosk mode

Message ID 1396453440-16445-10-git-send-email-daniel.thompson@linaro.org
State New
Headers show

Commit Message

Daniel Thompson April 2, 2014, 3:43 p.m. UTC
Currently 'help' in kiosk mode results in help text being issued for many
commands the user cannot actually run. Filter the help list when kiosk
mode is engaged to ensure help is fully relevant.

Filtering the list is also greatly simplifies scanning for commands that
may have been accidentally classified as safe.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
---
 kernel/debug/kdb/kdb_main.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 808bf55..77b6e61 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2401,6 +2401,9 @@  static int kdb_help(int argc, const char **argv)
 			return 0;
 		if (!kt->cmd_name)
 			continue;
+		if (kdb_kiosk &&
+		    !(kt->cmd_flags & (KDB_SAFE | KDB_SAFE_NO_ARGS)))
+			continue;
 		if (strlen(kt->cmd_usage) > 20)
 			space = "\n                                    ";
 		kdb_printf("%-15.15s %-20s%s%s\n", kt->cmd_name,