From: Colin Ian King Date: Tue, 15 Jun 2021 14:28:47 +0000 (+0100) Subject: ice: remove redundant continue statement in a for-loop X-Git-Tag: accepted/tizen/unified/20230118.172025~6942^2~131^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=587b839de733a8cdef3cbb805014e05229e7c96b;p=platform%2Fkernel%2Flinux-rpi.git ice: remove redundant continue statement in a for-loop 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 Reviewed-by: Jacob Keller Signed-off-by: Tony Nguyen --- diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c index 267312f..3eca0e4 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c @@ -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;