OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a872ab4
)
tty: localise ptychar and make it const
author
Jiri Slaby
<jslaby@suse.cz>
Tue, 2 Mar 2021 06:22:06 +0000
(07:22 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:34:09 +0000
(09:34 +0100)
ptychar was not const, so mark it as such. And move this variable to the
only place where it's used.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link:
https://lore.kernel.org/r/20210302062214.29627-36-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c
patch
|
blob
|
history
diff --git
a/drivers/tty/tty_io.c
b/drivers/tty/tty_io.c
index
c8cbf08
..
7cf57e6
100644
(file)
--- a/
drivers/tty/tty_io.c
+++ b/
drivers/tty/tty_io.c
@@
-1196,8
+1196,6
@@
int tty_send_xchar(struct tty_struct *tty, char ch)
return 0;
}
-static char ptychar[] = "pqrstuvwxyzabcde";
-
/**
* pty_line_name - generate name for a pty
* @driver: the tty driver in use
@@
-1211,6
+1209,7
@@
static char ptychar[] = "pqrstuvwxyzabcde";
*/
static void pty_line_name(struct tty_driver *driver, int index, char *p)
{
+ static const char ptychar[] = "pqrstuvwxyzabcde";
int i = index + driver->name_base;
/* ->name is initialized to "ttyp", but "tty" is expected */
sprintf(p, "%s%c%x",