Skip to contentSkip to conversation

scsi: qedf: Remove always false 'tmp_prio < 0' statement

PATCH Applied Austin Kim 3 participants 4 messages Sep 19, 2019 – Sep 25, 2019

Subsystems (2)
lore
Share & tools
lore

Austin Kim

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedf/qedf_main.c +1 -1
index 1659d35..59ca98f 100644
@@ -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);
Signature · 1 line
2.6.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 34 lines

-----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.

---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedf/qedf_main.c index renamed from drivers/scsi/qedf/qedf_main.c +0 -0

1659d35..59ca98f 100644

drivers/scsi/qedf/qedf_main.c +1 -1
@@ -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",
Quoted 3 lines

tmp_prio, QEDF_DEFAULT_PRIO);
--
2.6.2

Hi Austin,
Thanks for the patch.

#2 lore raw
In reply to Austin Kim

Austin,

Quoted 4 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
author
#3 lore raw

2019년 9월 24일 (화) 오전 11:32, Martin K. Petersen <[email protected]>님이 작성:

Quoted 3 lines

Austin,

[...]

Quoted 4 lines
Quoted 1 line

So remove 'always false' statement.

Applied to 5.4/scsi-fixes, thanks!

Good, thanks for information.

Quoted 2 lines

--
Martin K. Petersen Oracle Linux Engineering