Make pty_driver and pty_slave_driver local vars in legacy BSD pty code
PATCH 1/1 Make pty_driver and pty_slave_driver local vars in legacy BSD pty code
Make the pty_driver and pty_slave_driver global variables into local vars of legacy_pty_init() as that's the only thing that ever accesses the values.
Signed-off-by David Howells <[email protected]>
---
drivers/char/pty.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/char/pty.c +2 -2
@@ -326,8 +326,6 @@ static const struct tty_operations pty_ops = {/* Traditional BSD devices */ #ifdef CONFIG_LEGACY_PTYS -static struct tty_driver *pty_driver, *pty_slave_driver; -static int pty_bsd_ioctl (struct tty_struct *tty,struct file *file,unsigned int cmd,unsigned long arg) {
@@ -356,6 +354,8 @@ static const struct tty_operations pty_ops_bsd = {static void __init legacy_pty_init (void ) { +struct tty_driver *pty_driver, *pty_slave_driver; +if (legacy_count <=0 )return ;
Quoted 3 lines · David Howells
Make the
pty_driverandpty_slave_driverglobal variables into local vars oflegacy_pty_init()as that's the only thing that ever accesses the values.
I had already done this in my local tree due to the other thread about the whole broken legacy pty initialization. Committed that and pushed out.
Linus