[PATCH net-next 0/2] Small fixes for true expression checks

STALE1786d LANDED

Landed in mainline as 36d935a0a67e on 2021-10-26.

5 messages, 3 authors, 2021-10-26 · open the first message on its own page

[PATCH net-next 0/2] Small fixes for true expression checks

From: Jεan Sacren <hidden>
Date: 2021-10-23 09:26:35

From: Jean Sacren <redacted>

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(-)

[PATCH net-next 1/2] net: qed_ptp: fix check of true !rc expression

From: Jεan Sacren <hidden>
Date: 2021-10-23 09:26:26

From: Jean Sacren <redacted>

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

We should also use constant 0 for return.

Signed-off-by: Jean Sacren <redacted>
---
 drivers/net/ethernet/qlogic/qed/qed_ptp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_ptp.c b/drivers/net/ethernet/qlogic/qed/qed_ptp.c
index 2c62d732e5c2..295ce435a1a4 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_ptp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_ptp.c
@@ -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)

[PATCH net-next 2/2] net: qed_dev: fix check of true !rc expression

From: Jεan Sacren <hidden>
Date: 2021-10-23 09:26:32

From: Jean Sacren <redacted>

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

Signed-off-by: Jean Sacren <redacted>
---
 drivers/net/ethernet/qlogic/qed/qed_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index 18f3bf7c4dfe..cc4ec2bb36db 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -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;

Re: [PATCH net-next 0/2] Small fixes for true expression checks

From: Joe Perches <joe@perches.com>
Date: 2021-10-23 14:32:46

On Sat, 2021-10-23 at 03:26 -0600, Jεan Sacren wrote:
This series fixes checks of true !rc expression.
Found by inspection or tool?

Re: [PATCH net-next 0/2] Small fixes for true expression checks

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-10-26 02:20:19

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski [off-list ref]:

On Sat, 23 Oct 2021 03:26:16 -0600 you wrote:
From: Jean Sacren <redacted>

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help