The ARRAY_SIZE macro is convenient, yet mostly unused. Switch lots of
[coreboot.git] / src / northbridge / intel / e7525 / raminit.c
index 5b2d1dc2bde5b68a34401c7d4c961aedb44392c0..313dc0f9304c0839100cb747335101574e0bf33f 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 "e7525.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;