From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Tue, 07 Feb 2017 11:37:17 +0000 Subject: Re: [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero Message-Id: <20170207113717.GB11154@mwanda> List-Id: References: <20170207112738.18486-1-colin.king@canonical.com> In-Reply-To: <20170207112738.18486-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Colin King Cc: Adaptec OEM Raid Solutions , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org On Tue, Feb 07, 2017 at 11:27:38AM +0000, Colin King wrote: > From: Colin Ian King > > 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 > --- > 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