Skip to content

Commit

Permalink
kdb: Const qualifier for kdb_getstr's prompt argument
Browse files Browse the repository at this point in the history
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: Daniel Thompson <[email protected]>
Signed-off-by: Jason Wessel <[email protected]>
  • Loading branch information
daniel-thompson authored and jwessel committed Feb 19, 2015
1 parent fb6daa7 commit 32d375f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernel/debug/kdb/kdb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ static char *kdb_read(char *buffer, size_t bufsize)
* 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)
strncpy(kdb_prompt_str, prompt, CMD_BUFLEN);
Expand Down
2 changes: 1 addition & 1 deletion kernel/debug/kdb/kdb_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_send_sig_info(struct task_struct *p, struct siginfo *info);
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);

/* Defines for kdb_symbol_print */
Expand Down

0 comments on commit 32d375f

Please sign in to comment.