public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Malley <mail@chrismalley.co.uk>
To: Alan Cox <alan@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] riscom8: remove redundant null pointer test
Date: Mon, 12 May 2008 19:27:10 +0100	[thread overview]
Message-ID: <1210616830.7454.0.camel@localhost> (raw)

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);
-- 




             reply	other threads:[~2008-05-12 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-12 18:27 Chris Malley [this message]
2008-05-12 19:58 ` [PATCH] riscom8: remove redundant null pointer test Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1210616830.7454.0.camel@localhost \
    --to=mail@chrismalley.co.uk \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox