aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/mxser.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-03-05 08:52:01 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 14:42:21 -0500
commit410235fd4d20b8feaf8930a0575d23acc088aa87 (patch)
treead21d071a29ef0ad400393328ca4ab0588d5b2b7 /drivers/tty/mxser.c
parent44a1bfd95d0a6c0096e79a883197596e1ce83cc3 (diff)
TTY: remove unneeded tty->index checks
Checking if tty->index is in bounds is not needed. The tty has the index set in the initial open. This is done in get_tty_driver. And it can be only in interval <0,driver->num). So remove the tests which check exactly this interval. Some are left untouched as they check against the current backing device count. (Leaving apart that the check is racy in most of the cases.) Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/mxser.c')
-rw-r--r--drivers/tty/mxser.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 260d03123524..17ff377e4129 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -1010,8 +1010,6 @@ static int mxser_open(struct tty_struct *tty, struct file *filp)
1010 line = tty->index; 1010 line = tty->index;
1011 if (line == MXSER_PORTS) 1011 if (line == MXSER_PORTS)
1012 return 0; 1012 return 0;
1013 if (line < 0 || line > MXSER_PORTS)
1014 return -ENODEV;
1015 info = &mxser_boards[line / MXSER_PORTS_PER_BOARD].ports[line % MXSER_PORTS_PER_BOARD]; 1013 info = &mxser_boards[line / MXSER_PORTS_PER_BOARD].ports[line % MXSER_PORTS_PER_BOARD];
1016 if (!info->ioaddr) 1014 if (!info->ioaddr)
1017 return -ENODEV; 1015 return -ENODEV;