Skip to contentSkip to conversation

UBI: Add compile-time check for correct malloc area configuration

PATCH New Stefan Roese 1 participant 1 message Jun 4, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBI: Add compile-time check for correct malloc area configuration

UBI is quite memory greedy and requires at least approx. 512k of malloc area. This patch adds a compile-time check, so that boards will not build with less memory reserved for this area (CONFIG_SYS_MALLOC_LEN).

---
 drivers/mtd/ubi/build.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/mtd/ubi/build.c +4 -0
index f4b01a9..4f50b2d 100644
@@ -46,6 +46,10 @@
 #include <ubi_uboot.h>
 #include "ubi.h"
 
+#if (CONFIG_SYS_MALLOC_LEN < (512 << 10))
+#error Malloc area too small for UBI, increase CONFIG_SYS_MALLOC_LEN to >= 512k
+#endif
+
 /* Maximum length of the 'mtd=' parameter */
 #define MTD_PARAM_LEN_MAX 64
 
Signature · 1 line
1.6.3.2