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

Gavin Shan gwshan at linux.vnet.ibm.com
Fri Jul 10 10:17:50 AEST 2015


On Thu, Jul 09, 2015 at 07:17:06PM +0530, Kamalesh Babulal wrote:
>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>

Reviewed-by: Gavin Shan <gwshan at linux.vnet.ibm.com>

Thanks,
Gavin

>---
> 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
>
>_______________________________________________
>Skiboot mailing list
>Skiboot at lists.ozlabs.org
>https://lists.ozlabs.org/listinfo/skiboot



More information about the Skiboot mailing list