Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1674107 > unrolled thread

[PATCH] scsi: qedi: Remove comparison of u16 idx with zero.

Started byChristos Gkekas <chris.gekas@gmail.com>
First post2017-06-24 18:30 +0200
Last post2017-06-26 19:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] scsi: qedi: Remove comparison of u16 idx with zero. Christos Gkekas <chris.gekas@gmail.com> - 2017-06-24 18:30 +0200
    Re: [PATCH] scsi: qedi: Remove comparison of u16 idx with zero. "Rangankar, Manish" <Manish.Rangankar@cavium.com> - 2017-06-26 09:20 +0200
    Re: [PATCH] scsi: qedi: Remove comparison of u16 idx with zero. "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-06-26 19:50 +0200

#1674107 — [PATCH] scsi: qedi: Remove comparison of u16 idx with zero.

FromChristos Gkekas <chris.gekas@gmail.com>
Date2017-06-24 18:30 +0200
Subject[PATCH] scsi: qedi: Remove comparison of u16 idx with zero.
Message-ID<tVW6C-1BX-17@gated-at.bofh.it>
Variable idx is defined as u16 thus statement (idx < 0) is
always false and should be removed.

Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
---
 drivers/scsi/qedi/qedi_fw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c
index e937490..19254bd 100644
--- a/drivers/scsi/qedi/qedi_fw.c
+++ b/drivers/scsi/qedi/qedi_fw.c
@@ -333,7 +333,7 @@ static void qedi_get_rq_bdq_buf(struct qedi_ctx *qedi,
 
 	/* Obtain buffer address from rqe_opaque */
 	idx = cqe->rqe_opaque.lo;
-	if ((idx < 0) || (idx > (QEDI_BDQ_NUM - 1))) {
+	if (idx > (QEDI_BDQ_NUM - 1)) {
 		QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
 			  "wrong idx %d returned by FW, dropping the unsolicited pkt\n",
 			  idx);
@@ -370,7 +370,7 @@ static void qedi_put_rq_bdq_buf(struct qedi_ctx *qedi,
 
 	/* Obtain buffer address from rqe_opaque */
 	idx = cqe->rqe_opaque.lo;
-	if ((idx < 0) || (idx > (QEDI_BDQ_NUM - 1))) {
+	if (idx > (QEDI_BDQ_NUM - 1)) {
 		QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
 			  "wrong idx %d returned by FW, dropping the unsolicited pkt\n",
 			  idx);
-- 
2.7.4

[toc] | [next] | [standalone]


#1674491

From"Rangankar, Manish" <Manish.Rangankar@cavium.com>
Date2017-06-26 09:20 +0200
Message-ID<tWwts-7J5-3@gated-at.bofh.it>
In reply to#1674107

On 24/06/17 9:54 PM, "Christos Gkekas" <chris.gekas@gmail.com> wrote:

>Variable idx is defined as u16 thus statement (idx < 0) is
>always false and should be removed.
>
>Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
>---
> drivers/scsi/qedi/qedi_fw.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c
>index e937490..19254bd 100644
>--- a/drivers/scsi/qedi/qedi_fw.c
>+++ b/drivers/scsi/qedi/qedi_fw.c
>@@ -333,7 +333,7 @@ static void qedi_get_rq_bdq_buf(struct qedi_ctx *qedi,
> 
> 	/* Obtain buffer address from rqe_opaque */
> 	idx = cqe->rqe_opaque.lo;
>-	if ((idx < 0) || (idx > (QEDI_BDQ_NUM - 1))) {
>+	if (idx > (QEDI_BDQ_NUM - 1)) {
> 		QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
> 			  "wrong idx %d returned by FW, dropping the unsolicited pkt\n",
> 			  idx);
>@@ -370,7 +370,7 @@ static void qedi_put_rq_bdq_buf(struct qedi_ctx *qedi,
> 
> 	/* Obtain buffer address from rqe_opaque */
> 	idx = cqe->rqe_opaque.lo;
>-	if ((idx < 0) || (idx > (QEDI_BDQ_NUM - 1))) {
>+	if (idx > (QEDI_BDQ_NUM - 1)) {
> 		QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
> 			  "wrong idx %d returned by FW, dropping the unsolicited pkt\n",
> 			  idx);
>-- 
>2.7.4

Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com>

[toc] | [prev] | [next] | [standalone]


#1674974

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2017-06-26 19:50 +0200
Message-ID<tWGj8-5mb-7@gated-at.bofh.it>
In reply to#1674107
Christos,

> Variable idx is defined as u16 thus statement (idx < 0) is always
> false and should be removed.

Applied to 4.13/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web