From: Mirco Fuchs Date: Fri, 28 Apr 2006 08:42:05 +0200 Subject: [U-Boot-Users] [PATCH] complains on bad CFG_MAX_FLASH_SECT description Message-ID: <4451D55D.14586.14C5F5@mircofuchs.web.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, this Patch complains if the macro CFG_MAX_FLASH_SECT is smaller than the truly available flash sectors. best regards Mirco Signed-off-by: Mirco Fuchs --- --- u-boot_1.1.4/u-boot-1.1.4/drivers/cfi_flash.c 2006-03-12 02:13:21.000000000 +0100 +++ u-boot-1.1.4/drivers/cfi_flash.c 2006-04-27 17:41:54.495071792 +0200 @@ -1131,6 +1131,10 @@ ulong flash_get_size (ulong base, int ba erase_region_count = (tmp & 0xffff) + 1; debug ("erase_region_count = %d erase_region_size = %d\n", erase_region_count, erase_region_size); + if (erase_region_count > CFG_MAX_FLASH_SECT) { + printf ("*** Warning - nbr. of erase regions > CFG_MAX_FLASH_SECT\n"); + return 0; + } for (j = 0; j < erase_region_count; j++) { info->start[sect_cnt] = sector; sector += (erase_region_size * size_ratio);