aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/rocket.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/rocket.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/rocket.c')
-rw-r--r--drivers/tty/rocket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index b088e1ea4331..777d5f9cf6cc 100644
--- a/drivers/tty/rocket.c
+++ b/drivers/tty/rocket.c
@@ -892,12 +892,12 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
892{ 892{
893 struct r_port *info; 893 struct r_port *info;
894 struct tty_port *port; 894 struct tty_port *port;
895 int line = 0, retval; 895 int retval;
896 CHANNEL_t *cp; 896 CHANNEL_t *cp;
897 unsigned long page; 897 unsigned long page;
898 898
899 line = tty->index; 899 info = rp_table[tty->index];
900 if (line < 0 || line >= MAX_RP_PORTS || ((info = rp_table[line]) == NULL)) 900 if (info == NULL)
901 return -ENXIO; 901 return -ENXIO;
902 port = &info->port; 902 port = &info->port;
903 903