public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: Adaptec OEM Raid Solutions <aacraid@microsemi.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero
Date: Tue, 07 Feb 2017 11:37:17 +0000	[thread overview]
Message-ID: <20170207113717.GB11154@mwanda> (raw)
In-Reply-To: <20170207112738.18486-1-colin.king@canonical.com>

On Tue, Feb 07, 2017 at 11:27:38AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The check on rcode >= 0 is always true because rcode is unsigned
> and can never be less than zero.  Remove the redundant check.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/scsi/aacraid/aachba.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
> index 3b5ddf4..ddfd726 100644
> --- a/drivers/scsi/aacraid/aachba.c
> +++ b/drivers/scsi/aacraid/aachba.c
> @@ -1848,7 +1848,7 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan)
>  			FsaNormal, 1, 1, NULL, NULL);
>  
>  	/* analyse data */
> -	if (rcode >= 0 && phys_luns->resp_flag = 2) {

The original code is buggy.  rcode should be an int.

regards,
dan carpenter


  reply	other threads:[~2017-02-07 11:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 11:27 [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero Colin King
2017-02-07 11:37 ` Dan Carpenter [this message]
2017-02-07 11:37   ` Colin Ian King

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=20170207113717.GB11154@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=aacraid@microsemi.com \
    --cc=colin.king@canonical.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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