Commit 32d375f6 authored by Daniel Thompson's avatar Daniel Thompson Committed by Jason Wessel

kdb: Const qualifier for kdb_getstr's prompt argument

All current callers of kdb_getstr() can pass constant pointers via the
prompt argument. This patch adds a const qualification to make explicit
the fact that this is safe.
Signed-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
parent fb6daa75
...@@ -439,7 +439,7 @@ static char *kdb_read(char *buffer, size_t bufsize) ...@@ -439,7 +439,7 @@ static char *kdb_read(char *buffer, size_t bufsize)
* substituted for %d, %x or %o in the prompt. * substituted for %d, %x or %o in the prompt.
*/ */
char *kdb_getstr(char *buffer, size_t bufsize, char *prompt) char *kdb_getstr(char *buffer, size_t bufsize, const char *prompt)
{ {
if (prompt && kdb_prompt_str != prompt) if (prompt && kdb_prompt_str != prompt)
strncpy(kdb_prompt_str, prompt, CMD_BUFLEN); strncpy(kdb_prompt_str, prompt, CMD_BUFLEN);
......
...@@ -211,7 +211,7 @@ extern void kdb_ps1(const struct task_struct *p); ...@@ -211,7 +211,7 @@ extern void kdb_ps1(const struct task_struct *p);
extern void kdb_print_nameval(const char *name, unsigned long val); extern void kdb_print_nameval(const char *name, unsigned long val);
extern void kdb_send_sig_info(struct task_struct *p, struct siginfo *info); extern void kdb_send_sig_info(struct task_struct *p, struct siginfo *info);
extern void kdb_meminfo_proc_show(void); extern void kdb_meminfo_proc_show(void);
extern char *kdb_getstr(char *, size_t, char *); extern char *kdb_getstr(char *, size_t, const char *);
extern void kdb_gdb_state_pass(char *buf); extern void kdb_gdb_state_pass(char *buf);
/* Defines for kdb_symbol_print */ /* Defines for kdb_symbol_print */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment