summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorScott Duplichan <scott@notabs.org>2014-12-13 10:29:56 -0600
committerEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-12-13 18:48:39 +0100
commitf454ac82e638a5f4b1eb2b3cd41f2f19fb721504 (patch)
tree0762cca25e3f4a25fc9b57898bd341776b3da06c /src/cpu
parent8916d0dcc48f8c22b2825524b2d59545ad7e7d61 (diff)
downloadcoreboot-f454ac82e638a5f4b1eb2b3cd41f2f19fb721504.tar.xz
AMD model fxx powernow_acpi.c: Fix incorrect loop count
powernow_acpi.c array TDP has 20 entries, yet the loop that reads it processes 21 entries. This causes a gcc 4.9.2 build failure. Limit processing to 20 entries. Change-Id: Ice173b276293184386cd8943a3213f3154f86458 Signed-off-by: Scott Duplichan <scott@notabs.org> Reviewed-on: http://review.coreboot.org/7791 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/amd/model_fxx/powernow_acpi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cpu/amd/model_fxx/powernow_acpi.c b/src/cpu/amd/model_fxx/powernow_acpi.c
index b71b9406b2..2ef99fe1df 100644
--- a/src/cpu/amd/model_fxx/powernow_acpi.c
+++ b/src/cpu/amd/model_fxx/powernow_acpi.c
@@ -160,7 +160,7 @@ static void pstates_algorithm(u32 pcontrol_blk, u8 plen, u8 onlyBSP)
0x3000) >> 12;
cpuid1 = cpuid(0x80000001);
pwr_lmt = ((cpuid1.ebx & 0x1C0) >> 5) | ((cpuid1.ebx & 0x4000) >> 14);
- for (index = 0; index <= sizeof(TDP) / sizeof(TDP[0]); index++)
+ for (index = 0; index < ARRAY_SIZE(TDP); index++)
if (TDP[index].socket_type == CONFIG_CPU_SOCKET_TYPE &&
TDP[index].cmp_cap == cmp_cap &&
TDP[index].pwr_lmt == pwr_lmt) {