]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commite9b67b6faced7fc39c2f90f135e49f953ff9dc34
treead21d071a29ef0ad400393328ca4ab0588d5b2b7
parent7417ff5cdcb42918b078a3a458e940bcffedac45
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