[Skiboot] [RFC PATCH] hw/phb3: Fix logical operand

Kamalesh Babulal kamalesh at linux.vnet.ibm.com
Thu Jul 9 23:47:06 AEST 2015


In phb3_init_rc_cfg(), fix logical operand issue by guarding
p->has_link with brackets.

Fixes Coverity defect#97816.

Signed-off-by: Kamalesh Babulal <kamalesh at linux.vnet.ibm.com>
---
 hw/phb3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/phb3.c b/hw/phb3.c
index df9d57c..46f339e 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -3667,7 +3667,7 @@ static bool phb3_init_rc_cfg(struct phb3 *p)
 	/* Note: When link down, also disable rcvr errors */
 	phb3_pcicfg_write32(&p->phb, 0, aercap + PCIECAP_AER_CE_MASK,
 			    PCIECAP_AER_CE_ADV_NONFATAL |
-			    p->has_link ? 0 : PCIECAP_AER_CE_RECVR_ERR);
+			    (p->has_link ? 0 : PCIECAP_AER_CE_RECVR_ERR));
 	/* Enable ECRC generation & checking */
 	phb3_pcicfg_write32(&p->phb, 0, aercap + PCIECAP_AER_CAPCTL,
 			     PCIECAP_AER_CAPCTL_ECRCG_EN	|
-- 
2.1.2



More information about the Skiboot mailing list