Linux-SCSI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] scsi: dpt_i2o: drop unnecessary comparison statement
@ 2019-09-09  5:42 Austin Kim
  2019-09-10 11:17 ` Austin Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Austin Kim @ 2019-09-09  5:42 UTC (permalink / raw)
  To: aacraid, jejb, martin.petersen; +Cc: linux-kernel, linux-scsi

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 <austindh.kim@gmail.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 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


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

* Re: [PATCH] scsi: dpt_i2o: drop unnecessary comparison statement
  2019-09-09  5:42 [PATCH] scsi: dpt_i2o: drop unnecessary comparison statement Austin Kim
@ 2019-09-10 11:17 ` Austin Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Austin Kim @ 2019-09-10 11:17 UTC (permalink / raw)
  To: aacraid, jejb, martin.petersen; +Cc: linux-kernel, linux-scsi

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

Thanks,
Austin Kim

2019년 9월 9일 (월) 오후 2:42, Austin Kim <austindh.kim@gmail.com>님이 작성:
>
> 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 <austindh.kim@gmail.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 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
>

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09  5:42 [PATCH] scsi: dpt_i2o: drop unnecessary comparison statement Austin Kim
2019-09-10 11:17 ` Austin Kim

Linux-SCSI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-scsi/0 linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ https://lore.kernel.org/linux-scsi \
		linux-scsi@vger.kernel.org linux-scsi@archiver.kernel.org
	public-inbox-index linux-scsi


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-scsi


AGPL code for this site: git clone https://public-inbox.org/ public-inbox