Skip to content

Commit

Permalink
kdb: Merge identical case statements in kdb_read()
Browse files Browse the repository at this point in the history
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: [email protected] # Not a bug fix but it is needed for later bug fixes
Reviewed-by: Douglas Anderson <[email protected]>
Tested-by: Justin Stitt <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Daniel Thompson <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
daniel-thompson authored and AK-Papon committed Jun 19, 2024
1 parent 5dc8bdf commit 5c17963
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions kernel/debug/kdb/kdb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,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) +
Expand All @@ -337,15 +338,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;
Expand Down

0 comments on commit 5c17963

Please sign in to comment.