Skip to contentSkip to conversation

scsi: dpt_i2o: drop unnecessary comparison statement

PATCH In review Austin Kim 1 participant 2 messages Sep 9, 2019 – Sep 10, 2019 SCSI

lore
Share & tools
lore

Austin Kim

author
#0 lore raw

PATCH 1/1 scsi: dpt_i2o: drop unnecessary comparison statement

The type of 'chan' is u32 which contain non-negative value. So 'chan < 0' is statment is always false.

Remove unnecessary comparison statement

---
 drivers/scsi/dpt_i2o.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/dpt_i2o.c +1 -1
index abc74fd..df48ef5 100644
@@ -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];
Signature · 1 line
2.6.2
author
#1 lore raw

Hello, Maintainers...
Would you please review this patch and share the feedback?

Thanks,
Austin Kim

2019년 9월 9일 (월) 오후 2:42, Austin Kim <[email protected]>님이 작성:

Quoted 27 lines

The type of 'chan' is u32 which contain non-negative value. So 'chan < 0' is statment is always false.

Remove unnecessary comparison statement

---
 drivers/scsi/dpt_i2o.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/dpt_i2o.c +1 -2
index abc74fd..df48ef5 100644
@@ -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];
--

2.6.2