Small fixes for true expression checks
Subsystems (3)
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(-)
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
@@ -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 2/2 net: qed_dev: fix check of true !rc expression
In reply to Jεan SacrenFrom: 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
@@ -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 ;
Quoted 1 line · Jεan Sacren
This series fixes checks of true !rc expression.
Found by inspection or tool?
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