2019-09-19 07:58:30

by Austin Kim

[permalink] [raw]
Subject: [PATCH] scsi: qedf: Remove always false 'tmp_prio < 0' statement

Since tmp_prio is declared as u8, the following statement is always false.
tmp_prio < 0

So remove 'always false' statement.

Signed-off-by: Austin Kim <[email protected]>
---
drivers/scsi/qedf/qedf_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 1659d35..59ca98f 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -596,7 +596,7 @@ static void qedf_dcbx_handler(void *dev, struct qed_dcbx_get *get, u32 mib_type)
tmp_prio = get->operational.app_prio.fcoe;
if (qedf_default_prio > -1)
qedf->prio = qedf_default_prio;
- else if (tmp_prio < 0 || tmp_prio > 7) {
+ else if (tmp_prio > 7) {
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
"FIP/FCoE prio %d out of range, setting to %d.\n",
tmp_prio, QEDF_DEFAULT_PRIO);
--
2.6.2


2019-09-19 08:57:26

by Saurav Kashyap

[permalink] [raw]
Subject: RE: [PATCH] scsi: qedf: Remove always false 'tmp_prio < 0' statement



> -----Original Message-----
> From: [email protected] <[email protected]> On
> Behalf Of Austin Kim
> Sent: Thursday, September 19, 2019 1:26 PM
> To: [email protected]; [email protected]
> Cc: [email protected]; [email protected]; QLogic-Storage-
> [email protected]; [email protected]
> Subject: [PATCH] scsi: qedf: Remove always false 'tmp_prio < 0' statement
>
> Since tmp_prio is declared as u8, the following statement is always false.
> tmp_prio < 0
>
> So remove 'always false' statement.
>
> Signed-off-by: Austin Kim <[email protected]>
> ---
> drivers/scsi/qedf/qedf_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index
> 1659d35..59ca98f 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -596,7 +596,7 @@ static void qedf_dcbx_handler(void *dev, struct
> qed_dcbx_get *get, u32 mib_type)
> tmp_prio = get->operational.app_prio.fcoe;
> if (qedf_default_prio > -1)
> qedf->prio = qedf_default_prio;
> - else if (tmp_prio < 0 || tmp_prio > 7) {
> + else if (tmp_prio > 7) {
> QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
> "FIP/FCoE prio %d out of range, setting to %d.\n",
> tmp_prio, QEDF_DEFAULT_PRIO);
> --
> 2.6.2

Hi Austin,
Thanks for the patch.

Acked-by: Saurav Kashyap <[email protected]>

2019-09-26 07:27:01

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: qedf: Remove always false 'tmp_prio < 0' statement


Austin,

> Since tmp_prio is declared as u8, the following statement is always false.
> tmp_prio < 0
>
> So remove 'always false' statement.

Applied to 5.4/scsi-fixes, thanks!

--
Martin K. Petersen Oracle Linux Engineering

2019-09-26 09:26:42

by Austin Kim

[permalink] [raw]
Subject: Re: [PATCH] scsi: qedf: Remove always false 'tmp_prio < 0' statement

2019년 9월 24일 (화) 오전 11:32, Martin K. Petersen <[email protected]>님이 작성:
>
>
> Austin,
[...]
> > So remove 'always false' statement.
>
> Applied to 5.4/scsi-fixes, thanks!
>

Good, thanks for information.

> --
> Martin K. Petersen Oracle Linux Engineering