summaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia
diff options
context:
space:
mode:
authorJiri Slaby2012-03-05 14:52:01 +0100
committerGreg Kroah-Hartman2012-03-08 20:42:21 +0100
commit410235fd4d20b8feaf8930a0575d23acc088aa87 (patch)
treead21d071a29ef0ad400393328ca4ab0588d5b2b7 /drivers/char/pcmcia
parentTTY: serialP, remove DECLARE_WAITQUEUE check (diff)
downloadkernel-qcow2-linux-410235fd4d20b8feaf8930a0575d23acc088aa87.tar.gz
kernel-qcow2-linux-410235fd4d20b8feaf8930a0575d23acc088aa87.tar.xz
kernel-qcow2-linux-410235fd4d20b8feaf8930a0575d23acc088aa87.zip
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/char/pcmcia')
-rw-r--r--drivers/char/pcmcia/synclink_cs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index c3bcb1221e6b..f6453df4921c 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -2484,7 +2484,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
/* verify range of specified line number */
line = tty->index;
- if ((line < 0) || (line >= mgslpc_device_count)) {
+ if (line >= mgslpc_device_count) {
printk("%s(%d):mgslpc_open with invalid line #%d.\n",
__FILE__,__LINE__,line);
return -ENODEV;