m53menlo: Switch to deriving CONFIG_SYS_NAND_PAGE_COUNT
[platform/kernel/u-boot.git] / common / memsize.c
index c315275..d5d13d5 100644 (file)
@@ -1,11 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <init.h>
+#include <asm/global_data.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -27,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
 long get_ram_size(long *base, long maxsize)
 {
        volatile long *addr;
-       long           save[31];
+       long           save[BITS_PER_LONG - 1];
        long           save_base;
        long           cnt;
        long           val;