summaryrefslogtreecommitdiff
path: root/arch/ia64/hp
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-03-05 17:52:01 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 23:42:21 +0400
commit410235fd4d20b8feaf8930a0575d23acc088aa87 (patch)
treead21d071a29ef0ad400393328ca4ab0588d5b2b7 /arch/ia64/hp
parent44a1bfd95d0a6c0096e79a883197596e1ce83cc3 (diff)
downloadlinux-410235fd4d20b8feaf8930a0575d23acc088aa87.tar.xz
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 'arch/ia64/hp')
-rw-r--r--arch/ia64/hp/sim/simserial.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index f513dc02bb87..2a2fe0c56119 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -769,13 +769,10 @@ errout:
static int rs_open(struct tty_struct *tty, struct file * filp)
{
struct async_struct *info;
- int retval, line;
+ int retval;
unsigned long page;
- line = tty->index;
- if ((line < 0) || (line >= NR_PORTS))
- return -ENODEV;
- retval = get_async_struct(line, &info);
+ retval = get_async_struct(tty->index, &info);
if (retval)
return retval;
tty->driver_data = info;
@@ -920,7 +917,7 @@ simrs_init (void)
if (!ia64_platform_is("hpsim"))
return -ENODEV;
- hp_simserial_driver = alloc_tty_driver(1);
+ hp_simserial_driver = alloc_tty_driver(NR_PORTS);
if (!hp_simserial_driver)
return -ENOMEM;