Commit 80f6b2a5 authored by Paul Keith's avatar Paul Keith Committed by prady

sdm660-common: light: Drop unnecessary handled variable in setLight()

Change-Id: If6e76671cc1860102a5da6502338cda138dad3ee
parent 2c412af6
......@@ -224,7 +224,6 @@ namespace implementation {
Return<Status> Light::setLight(Type type, const LightState& state) {
LightStateHandler handler = nullptr;
bool handled = false;
/* Lock global mutex until light state is updated. */
std::lock_guard<std::mutex> lock(globalLock);
......@@ -246,15 +245,12 @@ Return<Status> Light::setLight(Type type, const LightState& state) {
for (LightBackend& backend : backends) {
if (handler == backend.handler && isLit(backend.state)) {
handler(backend.state);
handled = true;
break;
return Status::SUCCESS;
}
}
/* If no type has been lit up, then turn off the hardware. */
if (!handled) {
handler(state);
}
handler(state);
return Status::SUCCESS;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment