The ARRAY_SIZE macro is convenient, yet mostly unused. Switch lots of
[coreboot.git] / src / northbridge / intel / e7520 / raminit.c
index 672a117d7e2dee6010ec0141e18ce57c2f893d56..27ed477d9a309fbaaffa9fb89bb8af0eb35f0531 100644 (file)
@@ -21,6 +21,7 @@
 #include <cpu/x86/mem.h>
 #include <cpu/x86/mtrr.h>
 #include <cpu/x86/cache.h>
+#include <stdlib.h>
 #include "raminit.h"
 #include "e7520.h"
 
@@ -62,7 +63,7 @@ static void sdram_set_registers(const struct mem_controller *ctrl)
        int i;
        int max;
 
-       max = sizeof(register_values)/sizeof(register_values[0]);
+       max = ARRAY_SIZE(register_values);
        for(i = 0; i < max; i += 3) {
                device_t dev;
                unsigned where;