Skip to content

Commit 268f495

Browse files
eprucka3Gerrit Code Review
authored andcommitted
Merge "FTL: Silence warnings for FTL_FAKE_GUARD" into main
2 parents 95caae2 + 6ab6ccb commit 268f495

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

include/ftl/fake_guard.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,8 @@ struct [[clang::scoped_lockable]] FakeGuard final {
7676
FTL_ATTRIBUTE(release_capability(mutex))
7777
#endif
7878

79-
// The parentheses around `expr` are needed to deduce an lvalue or rvalue reference.
80-
#define FTL_FAKE_GUARD2(mutex, expr) \
81-
[&]() -> decltype(auto) { \
82-
const android::ftl::FakeGuard guard(mutex); \
83-
return (expr); \
84-
}()
79+
#define FTL_FAKE_GUARD2(mutex, expr) \
80+
(android::ftl::FakeGuard(mutex), expr)
8581

8682
#define FTL_MAKE_FAKE_GUARD(arg1, arg2, guard, ...) guard
8783

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6675,7 +6675,7 @@ void SurfaceFlinger::dumpOffscreenLayers(std::string& result) {
66756675
}
66766676

66776677
void SurfaceFlinger::dumpHwcLayersMinidumpLockedLegacy(std::string& result) const {
6678-
for (const auto& [token, display] : FTL_FAKE_GUARD(mStateLock, mDisplays)) {
6678+
for (const auto& [token, display] : mDisplays) {
66796679
const auto displayId = HalDisplayId::tryCast(display->getId());
66806680
if (!displayId) {
66816681
continue;
@@ -6695,7 +6695,7 @@ void SurfaceFlinger::dumpHwcLayersMinidump(std::string& result) const {
66956695
if (!mLayerLifecycleManagerEnabled) {
66966696
return dumpHwcLayersMinidumpLockedLegacy(result);
66976697
}
6698-
for (const auto& [token, display] : FTL_FAKE_GUARD(mStateLock, mDisplays)) {
6698+
for (const auto& [token, display] : mDisplays) {
66996699
const auto displayId = HalDisplayId::tryCast(display->getId());
67006700
if (!displayId) {
67016701
continue;

0 commit comments

Comments
 (0)