diff options
Diffstat (limited to 'src/southbridge/amd')
-rw-r--r-- | src/southbridge/amd/amd8111/amd8111_lpc.c | 3 | ||||
-rw-r--r-- | src/southbridge/amd/cs5536/cs5536.c | 3 | ||||
-rw-r--r-- | src/southbridge/amd/sb600/sb600_sm.c | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/southbridge/amd/amd8111/amd8111_lpc.c b/src/southbridge/amd/amd8111/amd8111_lpc.c index 65d3945fe5..802f3c1044 100644 --- a/src/southbridge/amd/amd8111/amd8111_lpc.c +++ b/src/southbridge/amd/amd8111/amd8111_lpc.c @@ -10,6 +10,7 @@ #include <pc80/mc146818rtc.h> #include <pc80/isa-dma.h> #include <cpu/x86/lapic.h> +#include <stdlib.h> #include "amd8111.h" #define NMI_OFF 0 @@ -77,7 +78,7 @@ static void setup_ioapic(void) ioapicregvalues[0].value_high = bsp_apicid<<(56-32); printk_debug("amd8111: ioapic bsp_apicid = %02x\n", bsp_apicid); - for (i = 0; i < sizeof(ioapicregvalues) / sizeof(ioapicregvalues[0]); + for (i = 0; i < ARRAY_SIZE(ioapicregvalues); i++, a++) { l[0] = (a->reg * 2) + 0x10; l[4] = a->value_low; diff --git a/src/southbridge/amd/cs5536/cs5536.c b/src/southbridge/amd/cs5536/cs5536.c index 51e9c6f788..0acc5ca5c2 100644 --- a/src/southbridge/amd/cs5536/cs5536.c +++ b/src/southbridge/amd/cs5536/cs5536.c @@ -29,6 +29,7 @@ #include <cpu/x86/msr.h> #include <cpu/amd/vr.h> #include <cpu/amd/geode_post_code.h> +#include <stdlib.h> #include "chip.h" #include "cs5536.h" @@ -93,7 +94,7 @@ struct FLASH_DEVICE FlashInitTable[] = { {FLASH_TYPE_NONE, 0, 0}, /* CS3, or Flash Device 3 */ }; -#define FlashInitTableLen (sizeof(FlashInitTable)/sizeof(FlashInitTable[0])) +#define FlashInitTableLen (ARRAY_SIZE(FlashInitTable)) uint32_t FlashPort[] = { MDD_LBAR_FLSH0, diff --git a/src/southbridge/amd/sb600/sb600_sm.c b/src/southbridge/amd/sb600/sb600_sm.c index 67d02dc891..97ad48f398 100644 --- a/src/southbridge/amd/sb600/sb600_sm.c +++ b/src/southbridge/amd/sb600/sb600_sm.c @@ -27,6 +27,7 @@ #include <bitops.h> #include <arch/io.h> #include <cpu/x86/lapic.h> +#include <stdlib.h> #include "sb600.h" #include "sb600_smbus.c" @@ -101,7 +102,7 @@ static void setup_ioapic(unsigned long ioapic_base) l = (unsigned long *)ioapic_base; - for (i = 0; i < sizeof(ioapicregvalues) / sizeof(ioapicregvalues[0]); + for (i = 0; i < ARRAY_SIZE(ioapicregvalues); i++, a++) { l[0] = (a->reg * 2) + 0x10; l[4] = a->value_low; |