aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
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/s390/char
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/s390/char')
-rw-r--r--drivers/s390/char/con3215.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index fe916bfd60f2..ed23fec7abbe 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -926,13 +926,9 @@ console_initcall(con3215_init);
926static int tty3215_open(struct tty_struct *tty, struct file * filp) 926static int tty3215_open(struct tty_struct *tty, struct file * filp)
927{ 927{
928 struct raw3215_info *raw; 928 struct raw3215_info *raw;
929 int retval, line; 929 int retval;
930 930
931 line = tty->index; 931 raw = raw3215[tty->index];
932 if ((line < 0) || (line >= NR_3215))
933 return -ENODEV;
934
935 raw = raw3215[line];
936 if (raw == NULL) 932 if (raw == NULL)
937 return -ENODEV; 933 return -ENODEV;
938 934