The code that handles case 14 (down) and case 16 (up) has been copy and
pasted despite being byte-for-byte identical. Combine them.

Signed-off-by: Daniel Thompson <daniel.thomp...@linaro.org>
---
 kernel/debug/kdb/kdb_io.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
index df7b5eb52d74f..08a86a329eb64 100644
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -294,6 +294,7 @@ static char *kdb_read(char *buffer, size_t bufsize)
                }
                break;
        case 14: /* Down */
+       case 16: /* Up */
                memset(tmpbuffer, ' ',
                       strlen(kdb_prompt_str) + (lastchar-buffer));
                *(tmpbuffer+strlen(kdb_prompt_str) +
@@ -308,15 +309,6 @@ static char *kdb_read(char *buffer, size_t bufsize)
                        ++cp;
                }
                break;
-       case 16: /* Up */
-               memset(tmpbuffer, ' ',
-                      strlen(kdb_prompt_str) + (lastchar-buffer));
-               *(tmpbuffer+strlen(kdb_prompt_str) +
-                 (lastchar-buffer)) = '\0';
-               kdb_printf("\r%s\r", tmpbuffer);
-               *lastchar = (char)key;
-               *(lastchar+1) = '\0';
-               return lastchar;
        case 9: /* Tab */
                if (tab < 2)
                        ++tab;

-- 
2.43.0



_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to