Skip to content

Commit

Permalink
ice: remove redundant continue statement in a for-loop
Browse files Browse the repository at this point in the history
The continue statement in the for-loop is redundant. Re-work the hw_lock
check to remove it.

Addresses-Coverity: ("Continue has no effect")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Colin Ian King authored and Tony Nguyen committed Jun 17, 2021
1 parent 4d7f75f commit 587b839
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/net/ethernet/intel/ice/ice_ptp_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,11 @@ bool ice_ptp_lock(struct ice_hw *hw)
for (i = 0; i < MAX_TRIES; i++) {
hw_lock = rd32(hw, PFTSYN_SEM + (PFTSYN_SEM_BYTES * hw->pf_id));
hw_lock = hw_lock & PFTSYN_SEM_BUSY_M;
if (hw_lock) {
/* Somebody is holding the lock */
usleep_range(10000, 20000);
continue;
} else {
if (!hw_lock)
break;
}

/* Somebody is holding the lock */
usleep_range(10000, 20000);
}

return !hw_lock;
Expand Down

0 comments on commit 587b839

Please sign in to comment.