net: qed_ptp: fix check of true !rc expression
authorJean Sacren <sakiwit@gmail.com>
Sat, 23 Oct 2021 09:26:14 +0000 (03:26 -0600)
committerJakub Kicinski <kuba@kernel.org>
Tue, 26 Oct 2021 02:11:13 +0000 (19:11 -0700)
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>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/qlogic/qed/qed_ptp.c

index 2c62d73..295ce43 100644 (file)
@@ -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)