diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-06-25 08:48:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:01:19 -0400 |
commit | 326f28e9ec4b2619c2fd410593fc95fcb0ba6b41 (patch) | |
tree | 2a11507d8ab266b1f0eac6d3b3f37e9d18ddec5d | |
parent | fa791f5bdfa026a9abe1b48934943fd39f1e300b (diff) |
[PATCH] More !tty cleanups in drivers/char
Another bunch of checks in the char drivers .put_char() and .write()
routines, where tty can never be NULL. This patch removes these checks to
save some code. Coverity choked at those with the following bug ids:
isicom.c 767, 766
specialix.c 773, 774
synclink_cs.c 779, 781
synclink_gt.c 784, 785
synclinkmp.c 784, 785
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Cc: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/char/isicom.c | 4 | ||||
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 4 | ||||
-rw-r--r-- | drivers/char/specialix.c | 4 | ||||
-rw-r--r-- | drivers/char/synclink_gt.c | 4 | ||||
-rw-r--r-- | drivers/char/synclinkmp.c | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index e9ebabaf8cb0..efaaa1937ab6 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c | |||
@@ -1145,7 +1145,7 @@ static int isicom_write(struct tty_struct *tty, const unsigned char *buf, | |||
1145 | if (isicom_paranoia_check(port, tty->name, "isicom_write")) | 1145 | if (isicom_paranoia_check(port, tty->name, "isicom_write")) |
1146 | return 0; | 1146 | return 0; |
1147 | 1147 | ||
1148 | if (!tty || !port->xmit_buf) | 1148 | if (!port->xmit_buf) |
1149 | return 0; | 1149 | return 0; |
1150 | 1150 | ||
1151 | spin_lock_irqsave(&card->card_lock, flags); | 1151 | spin_lock_irqsave(&card->card_lock, flags); |
@@ -1180,7 +1180,7 @@ static void isicom_put_char(struct tty_struct *tty, unsigned char ch) | |||
1180 | if (isicom_paranoia_check(port, tty->name, "isicom_put_char")) | 1180 | if (isicom_paranoia_check(port, tty->name, "isicom_put_char")) |
1181 | return; | 1181 | return; |
1182 | 1182 | ||
1183 | if (!tty || !port->xmit_buf) | 1183 | if (!port->xmit_buf) |
1184 | return; | 1184 | return; |
1185 | 1185 | ||
1186 | spin_lock_irqsave(&card->card_lock, flags); | 1186 | spin_lock_irqsave(&card->card_lock, flags); |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 0c141c295fb6..17bc8abd5df5 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -1582,7 +1582,7 @@ static void mgslpc_put_char(struct tty_struct *tty, unsigned char ch) | |||
1582 | if (mgslpc_paranoia_check(info, tty->name, "mgslpc_put_char")) | 1582 | if (mgslpc_paranoia_check(info, tty->name, "mgslpc_put_char")) |
1583 | return; | 1583 | return; |
1584 | 1584 | ||
1585 | if (!tty || !info->tx_buf) | 1585 | if (!info->tx_buf) |
1586 | return; | 1586 | return; |
1587 | 1587 | ||
1588 | spin_lock_irqsave(&info->lock,flags); | 1588 | spin_lock_irqsave(&info->lock,flags); |
@@ -1649,7 +1649,7 @@ static int mgslpc_write(struct tty_struct * tty, | |||
1649 | __FILE__,__LINE__,info->device_name,count); | 1649 | __FILE__,__LINE__,info->device_name,count); |
1650 | 1650 | ||
1651 | if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write") || | 1651 | if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write") || |
1652 | !tty || !info->tx_buf) | 1652 | !info->tx_buf) |
1653 | goto cleanup; | 1653 | goto cleanup; |
1654 | 1654 | ||
1655 | if (info->params.mode == MGSL_MODE_HDLC) { | 1655 | if (info->params.mode == MGSL_MODE_HDLC) { |
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 5343e9fc6ab7..1b5330299e30 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c | |||
@@ -1683,7 +1683,7 @@ static int sx_write(struct tty_struct * tty, | |||
1683 | 1683 | ||
1684 | bp = port_Board(port); | 1684 | bp = port_Board(port); |
1685 | 1685 | ||
1686 | if (!tty || !port->xmit_buf || !tmp_buf) { | 1686 | if (!port->xmit_buf || !tmp_buf) { |
1687 | func_exit(); | 1687 | func_exit(); |
1688 | return 0; | 1688 | return 0; |
1689 | } | 1689 | } |
@@ -1733,7 +1733,7 @@ static void sx_put_char(struct tty_struct * tty, unsigned char ch) | |||
1733 | return; | 1733 | return; |
1734 | } | 1734 | } |
1735 | dprintk (SX_DEBUG_TX, "check tty: %p %p\n", tty, port->xmit_buf); | 1735 | dprintk (SX_DEBUG_TX, "check tty: %p %p\n", tty, port->xmit_buf); |
1736 | if (!tty || !port->xmit_buf) { | 1736 | if (!port->xmit_buf) { |
1737 | func_exit(); | 1737 | func_exit(); |
1738 | return; | 1738 | return; |
1739 | } | 1739 | } |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index b4d1f4eea435..b4f1a5a435aa 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -870,7 +870,7 @@ static int write(struct tty_struct *tty, | |||
870 | goto cleanup; | 870 | goto cleanup; |
871 | DBGINFO(("%s write count=%d\n", info->device_name, count)); | 871 | DBGINFO(("%s write count=%d\n", info->device_name, count)); |
872 | 872 | ||
873 | if (!tty || !info->tx_buf) | 873 | if (!info->tx_buf) |
874 | goto cleanup; | 874 | goto cleanup; |
875 | 875 | ||
876 | if (count > info->max_frame_size) { | 876 | if (count > info->max_frame_size) { |
@@ -924,7 +924,7 @@ static void put_char(struct tty_struct *tty, unsigned char ch) | |||
924 | if (sanity_check(info, tty->name, "put_char")) | 924 | if (sanity_check(info, tty->name, "put_char")) |
925 | return; | 925 | return; |
926 | DBGINFO(("%s put_char(%d)\n", info->device_name, ch)); | 926 | DBGINFO(("%s put_char(%d)\n", info->device_name, ch)); |
927 | if (!tty || !info->tx_buf) | 927 | if (!info->tx_buf) |
928 | return; | 928 | return; |
929 | spin_lock_irqsave(&info->lock,flags); | 929 | spin_lock_irqsave(&info->lock,flags); |
930 | if (!info->tx_active && (info->tx_count < info->max_frame_size)) | 930 | if (!info->tx_active && (info->tx_count < info->max_frame_size)) |
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 858740131115..21bf15ad9980 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c | |||
@@ -988,7 +988,7 @@ static int write(struct tty_struct *tty, | |||
988 | if (sanity_check(info, tty->name, "write")) | 988 | if (sanity_check(info, tty->name, "write")) |
989 | goto cleanup; | 989 | goto cleanup; |
990 | 990 | ||
991 | if (!tty || !info->tx_buf) | 991 | if (!info->tx_buf) |
992 | goto cleanup; | 992 | goto cleanup; |
993 | 993 | ||
994 | if (info->params.mode == MGSL_MODE_HDLC) { | 994 | if (info->params.mode == MGSL_MODE_HDLC) { |
@@ -1067,7 +1067,7 @@ static void put_char(struct tty_struct *tty, unsigned char ch) | |||
1067 | if (sanity_check(info, tty->name, "put_char")) | 1067 | if (sanity_check(info, tty->name, "put_char")) |
1068 | return; | 1068 | return; |
1069 | 1069 | ||
1070 | if (!tty || !info->tx_buf) | 1070 | if (!info->tx_buf) |
1071 | return; | 1071 | return; |
1072 | 1072 | ||
1073 | spin_lock_irqsave(&info->lock,flags); | 1073 | spin_lock_irqsave(&info->lock,flags); |