TTY: remove unneeded tty->index checks
authorJiri Slaby <jslaby@suse.cz>
Mon, 5 Mar 2012 13:52:01 +0000 (14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Mar 2012 19:42:21 +0000 (11:42 -0800)
commit410235fd4d20b8feaf8930a0575d23acc088aa87
treead21d071a29ef0ad400393328ca4ab0588d5b2b7
parent44a1bfd95d0a6c0096e79a883197596e1ce83cc3
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>
21 files changed:
arch/ia64/hp/sim/simserial.c
arch/xtensa/platforms/iss/console.c
drivers/char/pcmcia/synclink_cs.c
drivers/isdn/capi/capi.c
drivers/isdn/gigaset/common.c
drivers/isdn/i4l/isdn_tty.c
drivers/s390/char/con3215.c
drivers/tty/amiserial.c
drivers/tty/cyclades.c
drivers/tty/hvc/hvcs.c
drivers/tty/hvc/hvsi.c
drivers/tty/isicom.c
drivers/tty/mxser.c
drivers/tty/rocket.c
drivers/tty/serial/68328serial.c
drivers/tty/serial/crisv10.c
drivers/tty/synclink.c
drivers/tty/synclink_gt.c
drivers/tty/synclinkmp.c
drivers/usb/gadget/u_serial.c
net/irda/ircomm/ircomm_tty.c