kdb: Use the passed prompt in kdb_position_cursor()
authorDouglas Anderson <dianders@chromium.org>
Tue, 28 May 2024 14:11:48 +0000 (07:11 -0700)
committerDaniel Thompson <daniel.thompson@linaro.org>
Fri, 21 Jun 2024 13:44:26 +0000 (14:44 +0100)
The function kdb_position_cursor() takes in a "prompt" parameter but
never uses it. This doesn't _really_ matter since all current callers
of the function pass the same value and it's a global variable, but
it's a bit ugly. Let's clean it up.

Found by code inspection. This patch is expected to functionally be a
no-op.

Fixes: 09b35989421d ("kdb: Use format-strings rather than '\0' injection in kdb_read()")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20240528071144.1.I0feb49839c6b6f4f2c4bf34764f5e95de3f55a66@changeid
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
kernel/debug/kdb/kdb_io.c

index 7da3fa7beffd0aa3efa0e07443e06cd830b9840b..6a77f1c779c4cc8b3fa10b9125a7765350b5b8b2 100644 (file)
@@ -206,7 +206,7 @@ char kdb_getchar(void)
  */
 static void kdb_position_cursor(char *prompt, char *buffer, char *cp)
 {
-       kdb_printf("\r%s", kdb_prompt_str);
+       kdb_printf("\r%s", prompt);
        if (cp > buffer)
                kdb_printf("%.*s", (int)(cp - buffer), buffer);
 }