From b21c1015fdae404e973bf79c6b5c2fa4f81e436e Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 23 Jun 2020 19:23:42 -0700 Subject: hwc_session: move a break As written, this loop only runs once, which makes clang's new warning unhappy: hardware/qcom/sm8150/display/sdm/libs/hwc2/hwc_session.cpp:934:51: error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment] Chatting with qcom, this appears to be a bug, and the best fix is to move the `break` into the `if`. Bug: 150166387 Test: TreeHugger Change-Id: Icb64eed5b894b9188f5265094587dd802207ba66 --- sdm/libs/hwc2/hwc_session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp index 794ebc33..750e104d 100644 --- a/sdm/libs/hwc2/hwc_session.cpp +++ b/sdm/libs/hwc2/hwc_session.cpp @@ -809,8 +809,8 @@ void HWCSession::HandlePendingRefresh() { for (size_t i = 0; i < pending_refresh_.size(); i++) { if (pending_refresh_.test(i)) { Refresh(i); + break; } - break; } pending_refresh_.reset(); -- cgit v1.2.3