netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: qed_ptp: fix check of true !rc expression
  2021-10-23  9:26 [PATCH net-next 0/2] Small fixes for true expression checks Jεan Sacren
@ 2021-10-23  9:26 ` Jεan Sacren
  2021-10-23  9:26 ` [PATCH net-next 2/2] net: qed_dev: " Jεan Sacren
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jεan Sacren @ 2021-10-23  9:26 UTC (permalink / raw)
  To: Ariel Elior; +Cc: GR-everest-linux-l2, davem, kuba, netdev

From: Jean Sacren <sakiwit@gmail.com>

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 <sakiwit@gmail.com>
---
 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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] net: qed_dev: fix check of true !rc expression
  2021-10-23  9:26 [PATCH net-next 0/2] Small fixes for true expression checks Jεan Sacren
  2021-10-23  9:26 ` [PATCH net-next 1/2] net: qed_ptp: fix check of true !rc expression Jεan Sacren
@ 2021-10-23  9:26 ` Jεan Sacren
  2021-10-23 14:32 ` [PATCH net-next 0/2] Small fixes for true expression checks Joe Perches
  2021-10-26  2:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Jεan Sacren @ 2021-10-23  9:26 UTC (permalink / raw)
  To: Ariel Elior; +Cc: GR-everest-linux-l2, davem, kuba, netdev

From: Jean Sacren <sakiwit@gmail.com>

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

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
 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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 0/2] Small fixes for true expression checks
@ 2021-10-23  9:26 Jεan Sacren
  2021-10-23  9:26 ` [PATCH net-next 1/2] net: qed_ptp: fix check of true !rc expression Jεan Sacren
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jεan Sacren @ 2021-10-23  9:26 UTC (permalink / raw)
  To: Ariel Elior; +Cc: GR-everest-linux-l2, davem, kuba, netdev

From: Jean Sacren <sakiwit@gmail.com>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] Small fixes for true expression checks
  2021-10-23  9:26 [PATCH net-next 0/2] Small fixes for true expression checks Jεan Sacren
  2021-10-23  9:26 ` [PATCH net-next 1/2] net: qed_ptp: fix check of true !rc expression Jεan Sacren
  2021-10-23  9:26 ` [PATCH net-next 2/2] net: qed_dev: " Jεan Sacren
@ 2021-10-23 14:32 ` Joe Perches
  2021-10-26  2:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2021-10-23 14:32 UTC (permalink / raw)
  To: Jεan Sacren, Ariel Elior; +Cc: GR-everest-linux-l2, davem, kuba, netdev

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?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] Small fixes for true expression checks
  2021-10-23  9:26 [PATCH net-next 0/2] Small fixes for true expression checks Jεan Sacren
                   ` (2 preceding siblings ...)
  2021-10-23 14:32 ` [PATCH net-next 0/2] Small fixes for true expression checks Joe Perches
@ 2021-10-26  2:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-26  2:20 UTC (permalink / raw)
  To: =?utf-8?q?J=CE=B5an_Sacren_=3Csakiwit=40gmail=2Ecom=3E?=
  Cc: aelior, GR-everest-linux-l2, davem, kuba, netdev

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 23 Oct 2021 03:26:16 -0600 you wrote:
> From: Jean Sacren <sakiwit@gmail.com>
> 
> 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-26  2:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-23  9:26 [PATCH net-next 0/2] Small fixes for true expression checks Jεan Sacren
2021-10-23  9:26 ` [PATCH net-next 1/2] net: qed_ptp: fix check of true !rc expression Jεan Sacren
2021-10-23  9:26 ` [PATCH net-next 2/2] net: qed_dev: " Jεan Sacren
2021-10-23 14:32 ` [PATCH net-next 0/2] Small fixes for true expression checks Joe Perches
2021-10-26  2:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).