John Zhao has uploaded this change for review. ( https://review.coreboot.org/28261
Change subject: soc/intel/apollolake: Fix logical vs. bitwise operator ......................................................................
soc/intel/apollolake: Fix logical vs. bitwise operator
src/soc/intel/apollolake/chip.c Apply bitwise operator instead of logical one.
Found-by: Coverity Scan BRANCH=None TEST=Built & booted Yorp board.
Change-Id: I36746b04dec889f53c8d7eeb3b1d8118eff1de42 Signed-off-by: John Zhao john.zhao@intel.com --- M src/soc/intel/apollolake/chip.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/28261/1
diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c index 83a6baa..9b8cfd7 100644 --- a/src/soc/intel/apollolake/chip.c +++ b/src/soc/intel/apollolake/chip.c @@ -678,7 +678,7 @@ cfg0 = (void *)(uintptr_t)(res->base + DUAL_ROLE_CFG0); cfg1 = (void *)(uintptr_t)(res->base + DUAL_ROLE_CFG1); reg = read32(cfg0); - if (!(reg && SW_IDPIN_EN_MASK)) + if (!(reg & SW_IDPIN_EN_MASK)) return;
reg &= ~(SW_IDPIN_MASK | SW_VBUS_VALID_MASK);