public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscom8: remove redundant null pointer test
@ 2008-05-12 18:27 Chris Malley
  2008-05-12 19:58 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Malley @ 2008-05-12 18:27 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

tty has already been dereferenced at least twice in these functions,
so checking for null here seems a bit unnecessary.

Signed-off-by: Chris Malley <mail@chrismalley.co.uk>
---
 drivers/char/riscom8.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index f073c71..9643a49 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -1108,7 +1108,7 @@ static int rc_write(struct tty_struct *tty,
 
 	bp = port_Board(port);
 
-	if (!tty || !port->xmit_buf)
+	if (!port->xmit_buf)
 		return 0;
 
 	while (1) {
@@ -1151,7 +1151,7 @@ static int rc_put_char(struct tty_struct *tty, unsigned char ch)
 	if (rc_paranoia_check(port, tty->name, "rc_put_char"))
 		return 0;
 
-	if (!tty || !port->xmit_buf)
+	if (!port->xmit_buf)
 		return 0;
 
 	spin_lock_irqsave(&riscom_lock, flags);
-- 




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-12 20:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-12 18:27 [PATCH] riscom8: remove redundant null pointer test Chris Malley
2008-05-12 19:58 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox