universal7885: run clang-format based on system-clang-format

* On every *.cpp *.h files

Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
roynatech2544 2021-12-12 20:37:53 +09:00
commit 098179eabb
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
47 changed files with 1545 additions and 1709 deletions

View file

@ -36,7 +36,7 @@
static const std::vector<std::string> fb_idle_patch = {"/sys/class/drm/card0/device/idle_state",
"/sys/class/graphics/fb0/idle_state"};
InteractionHandler::InteractionHandler(std::shared_ptr<HintManager> const &hint_manager)
InteractionHandler::InteractionHandler(std::shared_ptr<HintManager> const& hint_manager)
: mState(INTERACTION_STATE_UNINITIALIZED),
mWaitMs(100),
mMinDurationMs(1400),
@ -50,10 +50,9 @@ InteractionHandler::~InteractionHandler() {
static int fb_idle_open(void) {
int fd;
for (auto &path : fb_idle_patch) {
for (auto& path : fb_idle_patch) {
fd = open(path.c_str(), O_RDONLY);
if (fd >= 0)
return fd;
if (fd >= 0) return fd;
}
ALOGE("Unable to open fb idle state path (%d)", errno);
return -1;
@ -62,8 +61,7 @@ static int fb_idle_open(void) {
bool InteractionHandler::Init() {
std::lock_guard<std::mutex> lk(mLock);
if (mState != INTERACTION_STATE_UNINITIALIZED)
return true;
if (mState != INTERACTION_STATE_UNINITIALIZED) return true;
mIdleFd = fb_idle_open();
@ -84,8 +82,7 @@ bool InteractionHandler::Init() {
void InteractionHandler::Exit() {
std::unique_lock<std::mutex> lk(mLock);
if (mState == INTERACTION_STATE_UNINITIALIZED)
return;
if (mState == INTERACTION_STATE_UNINITIALIZED) return;
AbortWaitLocked();
mState = INTERACTION_STATE_UNINITIALIZED;
@ -186,8 +183,7 @@ void InteractionHandler::Release() {
void InteractionHandler::AbortWaitLocked() {
uint64_t val = 1;
ssize_t ret = write(mEventFd, &val, sizeof(val));
if (ret != sizeof(val))
ALOGW("Unable to write to event fd (%zd)", ret);
if (ret != sizeof(val)) ALOGW("Unable to write to event fd (%zd)", ret);
}
void InteractionHandler::WaitForIdle(int32_t wait_ms, int32_t timeout_ms) {
@ -253,8 +249,7 @@ void InteractionHandler::Routine() {
while (true) {
lk.lock();
mCond.wait(lk, [&] { return mState != INTERACTION_STATE_IDLE; });
if (mState == INTERACTION_STATE_UNINITIALIZED)
return;
if (mState == INTERACTION_STATE_UNINITIALIZED) return;
mState = INTERACTION_STATE_WAITING;
lk.unlock();