From e94335e9fd00ee5c707eb927922ef09b9487c5d6 Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Tue, 4 Jun 2019 11:35:14 -0600 Subject: nb/amd/amdmct/mct: Simplify conditional These if statements can be combined to merge the two branches of the conditional and remove the duplicate pDCTstat->Speed == 3 check. Change-Id: I41aa19b4b7ed7b1a0e4f83f72e66869760e677dd Signed-off-by: Jacob Garber Found-by: Coverity CID 1229583 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33211 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/northbridge/amd/amdmct/mct/mctardk3.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/northbridge/amd') diff --git a/src/northbridge/amd/amdmct/mct/mctardk3.c b/src/northbridge/amd/amdmct/mct/mctardk3.c index ce79a5245b..4eac790d5c 100644 --- a/src/northbridge/amd/amdmct/mct/mctardk3.c +++ b/src/northbridge/amd/amdmct/mct/mctardk3.c @@ -90,21 +90,13 @@ void mctGet_PS_Cfg_D(struct MCTStatStruc *pMCTstat, valx &= 0xAA; valx >>= 1; } - if (mctGet_NVbits(NV_MAX_DIMMS) == 8) { - val &= valx; - if (val != 0) { + val &= valx; + if (val != 0) { + if (mctGet_NVbits(NV_MAX_DIMMS) == 8 || + pDCTstat->Speed == 3) { pDCTstat->CH_ADDR_TMG[dct] &= 0xFFFF00FF; pDCTstat->CH_ADDR_TMG[dct] |= 0x00002F00; } - } else { - val &= valx; - if (val != 0) { - if (pDCTstat->Speed == 3 || pDCTstat->Speed == 3) { - pDCTstat->CH_ADDR_TMG[dct] &= 0xFFFF00FF; - pDCTstat->CH_ADDR_TMG[dct] |= 0x00002F00; - } - } - } } } -- cgit v1.2.3