From: Stefan Roese Date: Thu, 4 Jun 2009 14:55:34 +0000 (+0200) Subject: UBI: Add compile-time check for correct malloc area configuration X-Git-Tag: v2009.08-rc1~153^2~29 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=60cfe87bd39e6f07f2b92eb4bff82bfd105f4724;p=oweals%2Fu-boot.git 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). Signed-off-by: Stefan Roese --- diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index f4b01a9ded..4f50b2db62 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -46,6 +46,10 @@ #include #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