summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2024-04-24 15:03:37 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-16 13:28:52 +0200
commit147bac05f28ca848390f5eee0f53f39e37b852b8 (patch)
treef5da593a4a95e8bbea88b6bcd5da32a7caf93c64 /kernel
parent084e84ede9eb492e5a495a60ad14a2b3747db7e3 (diff)
downloadlinux-stable-147bac05f28ca848390f5eee0f53f39e37b852b8.tar.gz
linux-stable-147bac05f28ca848390f5eee0f53f39e37b852b8.tar.bz2
linux-stable-147bac05f28ca848390f5eee0f53f39e37b852b8.zip
kdb: Merge identical case statements in kdb_read()
commit 6244917f377bf64719551b58592a02a0336a7439 upstream. The code that handles case 14 (down) and case 16 (up) has been copy and pasted despite being byte-for-byte identical. Combine them. Cc: stable@vger.kernel.org # Not a bug fix but it is needed for later bug fixes Reviewed-by: Douglas Anderson <dianders@chromium.org> Tested-by: Justin Stitt <justinstitt@google.com> Link: https://lore.kernel.org/r/20240424-kgdb_read_refactor-v3-4-f236dbe9828d@linaro.org Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/debug/kdb/kdb_io.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
index bd1be0ed2c54..4eddb667ce76 100644
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -314,6 +314,7 @@ poll_again:
}
break;
case 14: /* Down */
+ case 16: /* Up */
memset(tmpbuffer, ' ',
strlen(kdb_prompt_str) + (lastchar-buffer));
*(tmpbuffer+strlen(kdb_prompt_str) +
@@ -328,15 +329,6 @@ poll_again:
++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;