scsi: dpt_i2o: Remove always false 'chan < 0' statement
authorXiongfeng Wang <wangxiongfeng2@huawei.com>
Wed, 29 Apr 2020 12:10:18 +0000 (20:10 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 30 Apr 2020 02:14:23 +0000 (22:14 -0400)
The channel index is represented by an unsigned variable 'u32 chan'. We
don't need to check whether it is less than zero, the 'chan < 0' statement
is always false. Remove it.

Link: https://lore.kernel.org/r/1588162218-61757-1-git-send-email-wangxiongfeng2@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/dpt_i2o.c

index 02dff3a684e0f180505e64419616eb2be833d147..2cf889512eceb90de302ede68edef2f6e2374756 100644 (file)
@@ -1120,7 +1120,7 @@ static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u6
 {
        struct adpt_device* d;
 
-       if(chan < 0 || chan >= MAX_CHANNEL)
+       if (chan >= MAX_CHANNEL)
                return NULL;
        
        d = pHba->channel[chan].device[id];