summaryrefslogtreecommitdiffstats
path: root/drivers/char/generic_serial.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-10-13 10:44:57 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 09:51:44 -0700
commit51383f69ec56fe3f425d5255fb43e18c445e061c (patch)
treef9d9e280892702c3a47ffa807c0937ea9c80e315 /drivers/char/generic_serial.c
parentea1afd256258f04a290aaa7fd5c2d4deb2e79e26 (diff)
downloadop-kernel-dev-51383f69ec56fe3f425d5255fb43e18c445e061c.zip
op-kernel-dev-51383f69ec56fe3f425d5255fb43e18c445e061c.tar.gz
tty: Remove lots of NULL checks
Many tty drivers contain 'can't happen' checks against NULL pointers passed in by the tty layer. These have never been possible to occur. Even more importantly if they ever do occur we want to know as it would be a serious bug. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/generic_serial.c')
-rw-r--r--drivers/char/generic_serial.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c
index 19d3afb..c6090f8 100644
--- a/drivers/char/generic_serial.c
+++ b/drivers/char/generic_serial.c
@@ -54,8 +54,6 @@ int gs_put_char(struct tty_struct * tty, unsigned char ch)
func_enter ();
- if (!tty) return 0;
-
port = tty->driver_data;
if (!port) return 0;
@@ -97,8 +95,6 @@ int gs_write(struct tty_struct * tty,
func_enter ();
- if (!tty) return 0;
-
port = tty->driver_data;
if (!port) return 0;
@@ -185,7 +181,6 @@ static int gs_real_chars_in_buffer(struct tty_struct *tty)
struct gs_port *port;
func_enter ();
- if (!tty) return 0;
port = tty->driver_data;
if (!port->rd) return 0;
@@ -274,8 +269,6 @@ void gs_flush_buffer(struct tty_struct *tty)
func_enter ();
- if (!tty) return;
-
port = tty->driver_data;
if (!port) return;
@@ -296,8 +289,6 @@ void gs_flush_chars(struct tty_struct * tty)
func_enter ();
- if (!tty) return;
-
port = tty->driver_data;
if (!port) return;
@@ -321,8 +312,6 @@ void gs_stop(struct tty_struct * tty)
func_enter ();
- if (!tty) return;
-
port = tty->driver_data;
if (!port) return;
@@ -341,8 +330,6 @@ void gs_start(struct tty_struct * tty)
{
struct gs_port *port;
- if (!tty) return;
-
port = tty->driver_data;
if (!port) return;
@@ -393,8 +380,6 @@ void gs_hangup(struct tty_struct *tty)
func_enter ();
- if (!tty) return;
-
port = tty->driver_data;
tty = port->port.tty;
if (!tty)
@@ -426,8 +411,6 @@ int gs_block_til_ready(void *port_, struct file * filp)
tty = port->port.tty;
- if (!tty) return 0;
-
gs_dprintk (GS_DEBUG_BTR, "Entering gs_block_till_ready.\n");
/*
* If the device is in the middle of being closed, then block
@@ -523,8 +506,6 @@ void gs_close(struct tty_struct * tty, struct file * filp)
func_enter ();
- if (!tty) return;
-
port = (struct gs_port *) tty->driver_data;
if (!port) return;
@@ -621,8 +602,6 @@ void gs_set_termios (struct tty_struct * tty,
func_enter();
- if (!tty) return;
-
port = tty->driver_data;
if (!port) return;
OpenPOWER on IntegriCloud