[coreboot-gerrit] Patch set updated for coreboot: 1837d79 northbridge/amd/amdfam10: Remove array to null comparison

Timothy Pearson (tpearson@raptorengineeringinc.com) gerrit at coreboot.org
Sun Apr 12 21:57:32 CEST 2015


Timothy Pearson (tpearson at raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9596

-gerrit

commit 1837d79a0177c215efac55d94e5269b95ebecc1b
Author: Timothy Pearson <tpearson at raptorengineeringinc.com>
Date:   Sun Apr 12 14:11:27 2015 -0500

    northbridge/amd/amdfam10: Remove array to null comparison
    
    The address of array 'sysinfo->DCTstatA' will always evaluate to 'true'.
    Remove checking the base pointer of an array for validity.
    
    Found-by: Coverity (CID 1293135: Incorrect expression)
    Found-by: Clang (Wpointer-bool-conversion)
    
    Change-Id: I99c9c9f1564dfb997c60b2a895d664e3b06c117b
    Signed-off-by: Timothy Pearson <tpearson at raptorengineeringinc.com>
---
 src/northbridge/amd/amdfam10/raminit_amdmct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/northbridge/amd/amdfam10/raminit_amdmct.c b/src/northbridge/amd/amdfam10/raminit_amdmct.c
index 6a71cd5..c167f0f 100644
--- a/src/northbridge/amd/amdfam10/raminit_amdmct.c
+++ b/src/northbridge/amd/amdfam10/raminit_amdmct.c
@@ -212,7 +212,7 @@ static void amdmct_cbmem_store_info(struct sys_info *sysinfo)
 	struct MCTStatStruc *pMCTstat = &(sysinfo->MCTstat);
 	struct DCTStatStruc *pDCTstatA = NULL;
 
-	if (pMCTstat && sysinfo->DCTstatA) {
+	if (pMCTstat) {
 		/* Allocate memory */
 		struct amdmct_memory_info* mem_info;
 		mem_info = cbmem_add(CBMEM_ID_AMDMCT_MEMINFO, sizeof(struct amdmct_memory_info));



More information about the coreboot-gerrit mailing list