Skip to contentSkip to conversation

Small fixes for true expression checks

PATCH Applied Jεan Sacren 3 participants 5 messages Oct 23, 2021 – Oct 26, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Small fixes for true expression checks

From: Jean Sacren <[email protected]>

This series fixes checks of true !rc expression.

Jean Sacren (2):
net: qed_ptp: fix check of true !rc expression
net: qed_dev: fix check of true !rc expression

 drivers/net/ethernet/qlogic/qed/qed_dev.c | 2 +-
 drivers/net/ethernet/qlogic/qed/qed_ptp.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
#1 lore raw

PATCH 1/2 net: qed_ptp: fix check of true !rc expression

From: Jean Sacren <[email protected]>

Remove the check of !rc in (!rc && !params.b_granted) since it is always true.

We should also use constant 0 for return.

---
 drivers/net/ethernet/qlogic/qed/qed_ptp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_ptp.c +2 -2
index 2c62d732e5c2..295ce435a1a4 100644
@@ -63,12 +63,12 @@ static int qed_ptp_res_lock(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 
 		DP_INFO(p_hwfn, "PF doesn't have lock ownership\n");
 		return -EBUSY;
-	} else if (!rc && !params.b_granted) {
+	} else if (!params.b_granted) {
 		DP_INFO(p_hwfn, "Failed to acquire ptp resource lock\n");
 		return -EBUSY;
 	}
 
-	return rc;
+	return 0;
 }
 
 static int qed_ptp_res_unlock(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
#2 lore raw

PATCH 2/2 net: qed_dev: fix check of true !rc expression

In reply to Jεan Sacren

From: Jean Sacren <[email protected]>

Remove the check of !rc in (!rc && !resc_lock_params.b_granted) since it is always true.

---
 drivers/net/ethernet/qlogic/qed/qed_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qed/qed_dev.c +1 -1
index 18f3bf7c4dfe..cc4ec2bb36db 100644
@@ -3992,7 +3992,7 @@ static int qed_hw_get_resc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 	} else if (rc == -EINVAL) {
 		DP_INFO(p_hwfn,
 			"Skip the max values setting of the soft resources since the resource lock is not supported by the MFW\n");
-	} else if (!rc && !resc_lock_params.b_granted) {
+	} else if (!resc_lock_params.b_granted) {
 		DP_NOTICE(p_hwfn,
 			  "Failed to acquire the resource lock for the resource allocation commands\n");
 		return -EBUSY;
#4 lore raw
In reply to Jεan Sacren
This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Sat, 23 Oct 2021 03:26:16 -0600 you wrote:

From: Jean Sacren <[email protected]>

This series fixes checks of true !rc expression.

Jean Sacren (2):
net: qed_ptp: fix check of true !rc expression
net: qed_dev: fix check of true !rc expression

[...]

Here is the summary with links:
- [net-next,1/2] net: qed_ptp: fix check of true !rc expression

    https://git.kernel.org/netdev/net-next/c/165f8e82c2f1
  - [net-next,2/2] net: qed_dev: fix check of true !rc expression
    https://git.kernel.org/netdev/net-next/c/036f590fe572

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html