diff options
author | Jiri Slaby <jslaby@suse.cz> | 2021-03-02 07:22:06 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-10 09:34:09 +0100 |
commit | a846dcf9d7295dd45493002fdde081f1667a85d3 (patch) | |
tree | a5c6053e78d9357ec7620d5527276a74edb8411c /drivers | |
parent | a872ab4d6d191cca1ce84b945e394bd6a8d84dd9 (diff) | |
download | linux-a846dcf9d7295dd45493002fdde081f1667a85d3.tar.gz linux-a846dcf9d7295dd45493002fdde081f1667a85d3.tar.bz2 linux-a846dcf9d7295dd45493002fdde081f1667a85d3.zip |
tty: localise ptychar and make it const
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/tty_io.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index c8cbf08b6dcf..7cf57e6cadbf 100644 --- 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", |