public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: James.Bottomley@suse.de, Karen Xie <kxie@chelsio.com>,
	james.smart@emulex.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -2nd repost 2/4] SCSI: remove unnecessary NULL test
Date: Wed, 04 Nov 2009 10:22:15 -0600	[thread overview]
Message-ID: <4AF1AA37.5060500@cs.wisc.edu> (raw)
In-Reply-To: <1257351321-8281-2-git-send-email-jirislaby@gmail.com>

Adding Karen and removing adaptec since this is chelsio's driver.

Jiri Slaby wrote:
> Stanse found that c3cn is poked many times around in
> cxgb3i_conn_pdu_ready, there is no need to check if it is NULL.
> 
> Remove the test.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> Cc: James E.J. Bottomley <James.Bottomley@suse.de>
> ---
>  drivers/scsi/cxgb3i/cxgb3i_pdu.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/cxgb3i/cxgb3i_pdu.c b/drivers/scsi/cxgb3i/cxgb3i_pdu.c
> index 7091050..64bbc28 100644
> --- a/drivers/scsi/cxgb3i/cxgb3i_pdu.c
> +++ b/drivers/scsi/cxgb3i/cxgb3i_pdu.c
> @@ -461,10 +461,8 @@ void cxgb3i_conn_pdu_ready(struct s3_conn *c3cn)
>  		skb = skb_peek(&c3cn->receive_queue);
>  	}
>  	read_unlock(&c3cn->callback_lock);
> -	if (c3cn) {
> -		c3cn->copied_seq += read;
> -		cxgb3i_c3cn_rx_credits(c3cn, read);
> -	}
> +	c3cn->copied_seq += read;
> +	cxgb3i_c3cn_rx_credits(c3cn, read);
>  	conn->rxdata_octets += read;
>  
>  	if (err) {

Looks ok to me. The null check was useless since we access c3cn all over 
the function and would have oopsed before we got there.

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>

  reply	other threads:[~2009-11-04 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-04 16:15 [PATCH -2nd repost 1/4] SCSI: aacraid, fix memory leak Jiri Slaby
2009-11-04 16:15 ` [PATCH -2nd repost 2/4] SCSI: remove unnecessary NULL test Jiri Slaby
2009-11-04 16:22   ` Mike Christie [this message]
2009-11-04 18:18   ` Karen Xie
2009-11-04 16:15 ` [PATCH -2nd repost 3/4] SCSI: lpfc, fix memory leak Jiri Slaby
2009-11-04 16:15 ` [PATCH -2nd repost 4/4] SCSI: scsi_lib, fix potential NULL dereference Jiri Slaby

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=4AF1AA37.5060500@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Bottomley@suse.de \
    --cc=james.smart@emulex.com \
    --cc=jirislaby@gmail.com \
    --cc=kxie@chelsio.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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