linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: dpt_i2o: Remove always false 'chan < 0' statement
@ 2020-04-29 12:10 Xiongfeng Wang
  2020-04-30  2:18 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Xiongfeng Wang @ 2020-04-29 12:10 UTC (permalink / raw)
  To: aacraid, jejb, martin.petersen, linux-scsi, linux-kernel, wangxiongfeng2

The channel index is represented by an unsigned variable 'u32 chan'. We
don't need to check whether it is less than zero. The following
statement is always false and let's remove it.
	'chan < 0'

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
---
 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 02dff3a..2cf8895 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];
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: dpt_i2o: Remove always false 'chan < 0' statement
  2020-04-29 12:10 [PATCH] scsi: dpt_i2o: Remove always false 'chan < 0' statement Xiongfeng Wang
@ 2020-04-30  2:18 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2020-04-30  2:18 UTC (permalink / raw)
  To: aacraid, jejb, linux-scsi, linux-kernel, Xiongfeng Wang
  Cc: Martin K . Petersen

On Wed, 29 Apr 2020 20:10:18 +0800, Xiongfeng Wang wrote:

> The channel index is represented by an unsigned variable 'u32 chan'. We
> don't need to check whether it is less than zero. The following
> statement is always false and let's remove it.
> 	'chan < 0'

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: dpt_i2o: Remove always false 'chan < 0' statement
      https://git.kernel.org/mkp/scsi/c/6f41f08c88c5

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-30  2:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 12:10 [PATCH] scsi: dpt_i2o: Remove always false 'chan < 0' statement Xiongfeng Wang
2020-04-30  2:18 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).