drm_hwcomposer: Use ALOG_IF to simplify logging
Prefer ALOG_IF rather than if(...) { ALOG() } to reduce nesting
and simplify the code.
Change-Id: I48e9ad952d7ecf5c60c274a056772029f4cd65c6
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp
index 7559835..159314c 100644
--- a/hwc2_device/HwcDisplay.cpp
+++ b/hwc2_device/HwcDisplay.cpp
@@ -614,9 +614,7 @@
}
if (!current_plan_) {
- if (!a_args.test_only) {
- ALOGE("Failed to create DrmKmsPlan");
- }
+ ALOGE_IF(!a_args.test_only, "Failed to create DrmKmsPlan");
return HWC2::Error::BadConfig;
}
@@ -625,8 +623,7 @@
auto ret = GetPipe().atomic_state_manager->ExecuteAtomicCommit(a_args);
if (ret) {
- if (!a_args.test_only)
- ALOGE("Failed to apply the frame composition ret=%d", ret);
+ ALOGE_IF(!a_args.test_only, "Failed to apply the frame composition ret=%d", ret);
return HWC2::Error::BadParameter;
}