Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1575572 > unrolled thread

[PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero

Started byColin King <colin.king@canonical.com>
First post2017-02-07 12:30 +0100
Last post2017-02-07 12:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero Colin King <colin.king@canonical.com> - 2017-02-07 12:30 +0100
    Re: [PATCH] scsi: aacraid: rcode is unsigned, so can never be less  than zero Colin Ian King <colin.king@canonical.com> - 2017-02-07 12:40 +0100
    Re: [PATCH] scsi: aacraid: rcode is unsigned, so can never be less  than zero Dan Carpenter <dan.carpenter@oracle.com> - 2017-02-07 12:40 +0100

#1575572 — [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero

FromColin King <colin.king@canonical.com>
Date2017-02-07 12:30 +0100
Subject[PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero
Message-ID<t8c8a-2bv-3@gated-at.bofh.it>
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) {
+	if (phys_luns->resp_flag == 2) {
 		/* ok and extended reporting */
 		aac_update_hba_map(dev, phys_luns, rescan);
 	}
-- 
2.10.2

[toc] | [next] | [standalone]


#1575580 — Re: [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero

FromColin Ian King <colin.king@canonical.com>
Date2017-02-07 12:40 +0100
SubjectRe: [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero
Message-ID<t8chQ-2ff-23@gated-at.bofh.it>
In reply to#1575572
On 07/02/17 11:37, Dan Carpenter wrote:
> 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.

Thanks for spotting that. Oops.

> 
> regards,
> dan carpenter
> 

[toc] | [prev] | [next] | [standalone]


#1575583 — Re: [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-02-07 12:40 +0100
SubjectRe: [PATCH] scsi: aacraid: rcode is unsigned, so can never be less than zero
Message-ID<t8chQ-2ff-25@gated-at.bofh.it>
In reply to#1575572
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web