From b5a6873157670ce950384636a776ff070faac33b Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Fri, 13 Jan 2017 17:16:21 -0800 Subject: Fix incorrect use of the ! operator. Bug: http://b/31532493 Operator precedence means that the unary ! will apply to hwcLayer->getUsage() before applying the unary & operator with GRALLOC_USAGE_HW_COMPOSER. This means that these checks will always fail (because it is defined as 0x00000800U). This code has either never executed, or just chose a fallback path to continue working. Test: Built without errors/warnings using new compiler. Change-Id: Ie5d67369edd801d3944be2dba9b3cc4ec289949a --- moorefield_hdmi/common/base/HwcLayerList.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moorefield_hdmi/common/base/HwcLayerList.cpp b/moorefield_hdmi/common/base/HwcLayerList.cpp index 5185e98..c163c8a 100755 --- a/moorefield_hdmi/common/base/HwcLayerList.cpp +++ b/moorefield_hdmi/common/base/HwcLayerList.cpp @@ -68,7 +68,7 @@ bool HwcLayerList::checkSupported(int planeType, HwcLayer *hwcLayer) } // check usage - if (!hwcLayer->getUsage() & GRALLOC_USAGE_HW_COMPOSER) { + if (!(hwcLayer->getUsage() & GRALLOC_USAGE_HW_COMPOSER)) { WLOGTRACE("not a composer layer"); return false; } @@ -134,7 +134,7 @@ bool HwcLayerList::checkRgbOverlaySupported(HwcLayer *hwcLayer) } // check usage - if (!hwcLayer->getUsage() & GRALLOC_USAGE_HW_COMPOSER) { + if (!(hwcLayer->getUsage() & GRALLOC_USAGE_HW_COMPOSER)) { WLOGTRACE("not a composer layer"); return false; } @@ -204,7 +204,7 @@ bool HwcLayerList::checkCursorSupported(HwcLayer *hwcLayer) } // check usage - if (!hwcLayer->getUsage() & GRALLOC_USAGE_HW_COMPOSER) { + if (!(hwcLayer->getUsage() & GRALLOC_USAGE_HW_COMPOSER)) { WLOGTRACE("not a composer layer"); return false; } -- cgit v1.2.3