Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33210 )
Change subject: nb/amd/amdfam10: Use 64 bits in multiplication ......................................................................
nb/amd/amdfam10: Use 64 bits in multiplication
The literal needs to be cast to a uint64 to prevent num_nodes from being implicitly promoted to a signed int.
Change-Id: Id2fa328fb8d0a9827c7c78157c024736e9b26dc4 Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1347343 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33210 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Martin Roth martinroth@google.com Reviewed-by: HAOUAS Elyes ehaouas@noos.fr --- M src/northbridge/amd/amdfam10/northbridge.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Martin Roth: Looks good to me, approved HAOUAS Elyes: Looks good to me, but someone else must approve
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c index 0c594b9..e28b89b 100644 --- a/src/northbridge/amd/amdfam10/northbridge.c +++ b/src/northbridge/amd/amdfam10/northbridge.c @@ -779,7 +779,7 @@
/* Calculate CC6 storage area size */ if (interleaved) - qword = (0x1000000 * num_nodes); + qword = (uint64_t)0x1000000 * num_nodes; else qword = 0x1000000;