[PATCH] scsi: dpt_i2o: drop unnecessary comparison statement

Subsystems: scsi subsystem, the rest

STALE2585d

2 messages, 1 author, 2019-09-10 · open the first message on its own page

[PATCH] scsi: dpt_i2o: drop unnecessary comparison statement

From: Austin Kim <hidden>
Date: 2019-09-09 05:42:27

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

Remove unnecessary comparison statement

Signed-off-by: Austin Kim <redacted>
---
 drivers/scsi/dpt_i2o.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index abc74fd..df48ef5 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -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

Re: [PATCH] scsi: dpt_i2o: drop unnecessary comparison statement

From: Austin Kim <hidden>
Date: 2019-09-10 11:18:08

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

Thanks,
Austin Kim

2019년 9월 9일 (월) 오후 2:42, Austin Kim [off-list ref]님이 작성:
quoted hunk
The type of 'chan' is u32 which contain non-negative value.
So 'chan < 0' is statment is always false.

Remove unnecessary comparison statement

Signed-off-by: Austin Kim <redacted>
---
 drivers/scsi/dpt_i2o.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index abc74fd..df48ef5 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help