scsi: dpt_i2o: remove redundant null check on array device
authorColin Ian King <colin.king@canonical.com>
Wed, 9 Aug 2017 10:17:41 +0000 (11:17 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 10 Aug 2017 23:55:35 +0000 (19:55 -0400)
The null check on pHba->channel[chan].device is redundant because
device is an array and hence can never be null. Remove the check.

Detected by CoverityScan, CID#115362 ("Array compared against 0")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/dpt_i2o.c

index 256dd6791fcc8bb0196e359ba6bd509c234080e3..fd172b0890d33a153e546e1faebad7d71a2d4937 100644 (file)
@@ -1169,11 +1169,6 @@ static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u6
        if(chan < 0 || chan >= MAX_CHANNEL)
                return NULL;
        
-       if( pHba->channel[chan].device == NULL){
-               printk(KERN_DEBUG"Adaptec I2O RAID: Trying to find device before they are allocated\n");
-               return NULL;
-       }
-
        d = pHba->channel[chan].device[id];
        if(!d || d->tid == 0) {
                return NULL;