[coreboot-gerrit] New patch to review for coreboot: 5a4f850 northbridge/amd/pi/northbridge.c: Remove superfluous logic operand

Alexandru Gagniuc (mr.nuke.me@gmail.com) gerrit at coreboot.org
Mon Dec 29 03:53:02 CET 2014


Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7965

-gerrit

commit 5a4f8503ad237e512d1fca12dd524028c2d508ee
Author: Alexandru Gagniuc <mr.nuke.me at gmail.com>
Date:   Sun Dec 28 20:38:32 2014 -0600

    northbridge/amd/pi/northbridge.c: Remove superfluous logic operand
    
    The "((1ull << (sizeof(modules) * 8)) - 1)" statement evaluates to
    0xffffffff, but there's no need to AND with that value, as 'modules'
    is already 32-bit. The '&&' is most likely a typo, which meant bitwise
    and, as indicated by the structure of thus operation.
    
    Remove this superfluous statement. This also fixes a clang warning.
    
    Change-Id: Ie55bd9f8b0ec5fd41e440f56dcedd40c830bf826
    Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
---
 src/northbridge/amd/pi/00730F01/northbridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index c8f938b..ca8fa27 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -901,7 +901,7 @@ static u32 cpu_bus_scan(device_t dev, u32 max)
 	printk(BIOS_SPEW, "MullinsPI Debug: Grabbing the AMD Topology Information.\n");
 	AmdGetValue(AMD_GLOBAL_USER_OPTIONS, (VOID**)&options, sizeof(options));
 	AmdGetValue(AMD_GLOBAL_NUM_MODULES, &modules_ptr, sizeof(modules));
-	modules = (*(u32*)modules_ptr) && ((1ull << (sizeof(modules) * 8)) - 1);
+	modules = *(u32*)modules_ptr;
 	ASSERT(modules > 0);
 	ASSERT(options);
 	ioapic_count = (int)options->CfgPlatNumIoApics;



More information about the coreboot-gerrit mailing list