diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2019-10-25 09:33:26 +0200 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2019-10-28 13:07:57 +0100 |
commit | 4f27e824bf83dfc2f6dc1a54fae419be7cd335af (patch) | |
tree | ad3f49c857d6cfe483e4a3dbc18afcf8a604f9a7 /kernel/debug/kdb/kdb_private.h | |
parent | kdb: Simplify code to fetch characters from console (diff) | |
download | linux-4f27e824bf83dfc2f6dc1a54fae419be7cd335af.tar.xz linux-4f27e824bf83dfc2f6dc1a54fae419be7cd335af.zip |
kdb: Remove special case logic from kdb_read()
kdb_read() contains special case logic to force it exit after reading
a single character. We can remove all the special case logic by directly
calling the function to read a single character instead. This also
allows us to tidy up the function prototype which, because it now matches
getchar(), we can also rename in order to make its role clearer.
This does involve some extra code to handle btaprompt properly but we
don't mind the new lines of code here because the old code had some
interesting problems (bad newline handling, treating unexpected
characters like <cr>).
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20191025073328.643-4-daniel.thompson@linaro.org
Diffstat (limited to 'kernel/debug/kdb/kdb_private.h')
-rw-r--r-- | kernel/debug/kdb/kdb_private.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/debug/kdb/kdb_private.h b/kernel/debug/kdb/kdb_private.h index 2118d8258b7c..55d052061ef9 100644 --- a/kernel/debug/kdb/kdb_private.h +++ b/kernel/debug/kdb/kdb_private.h @@ -210,6 +210,7 @@ extern void kdb_ps1(const struct task_struct *p); extern void kdb_print_nameval(const char *name, unsigned long val); extern void kdb_send_sig(struct task_struct *p, int sig); extern void kdb_meminfo_proc_show(void); +extern char kdb_getchar(void); extern char *kdb_getstr(char *, size_t, const char *); extern void kdb_gdb_state_pass(char *buf); |