aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/hvc/hvsi.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/hvc/hvsi.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/hvc/hvsi.c')
-rw-r--r--drivers/tty/hvc/hvsi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
index 60bc45164189..a7488b748647 100644
--- a/drivers/tty/hvc/hvsi.c
+++ b/drivers/tty/hvc/hvsi.c
@@ -737,14 +737,11 @@ static int hvsi_open(struct tty_struct *tty, struct file *filp)
737{ 737{
738 struct hvsi_struct *hp; 738 struct hvsi_struct *hp;
739 unsigned long flags; 739 unsigned long flags;
740 int line = tty->index;
741 int ret; 740 int ret;
742 741
743 pr_debug("%s\n", __func__); 742 pr_debug("%s\n", __func__);
744 743
745 if (line < 0 || line >= hvsi_count) 744 hp = &hvsi_ports[tty->index];
746 return -ENODEV;
747 hp = &hvsi_ports[line];
748 745
749 tty->driver_data = hp; 746 tty->driver_data = hp;
750 747