hv: treewide: fix 'Array has no bounds specified'

MISRAC requires that the array size should be declared explicitly.

This patch fixes the issues caused by the arrays that are defined in
link_ram.ld.in or assembly file.

v1 -> v2:
 * Update the solution based on the info from the following link.
   https://sourceware.org/binutils/docs/ld/Source-Code-Reference.html

   Fix pattern is like below:
   extern char start_of_ROM, end_of_ROM, start_of_FLASH;
   memcpy (& start_of_FLASH, & start_of_ROM, & end_of_ROM - &
start_of_ROM);

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shiqing Gao
2018-07-31 14:05:57 +08:00
committed by lijinxia
parent a3b44a2fa8
commit a71dedecd4
5 changed files with 40 additions and 35 deletions

View File

@@ -369,7 +369,8 @@ void bsp_boot_init(void)
start_tsc = rdtsc();
/* Clear BSS */
(void)memset(_ld_bss_start, 0U, (size_t)(_ld_bss_end - _ld_bss_start));
(void)memset(&_ld_bss_start, 0U,
(size_t)(&_ld_bss_end - &_ld_bss_start));
/* Build time sanity checks to make sure hard-coded offset
* is matching the actual offset!