u-boot-brain/board/freescale
Masahiro Yamada 61f06b143e m68k: fix an undefined behavior warning of M5253DEMO board
The latest GCC is so clever that it reports more warnings
than old ones did:

 ------------------------------>8------------------------------

  board/freescale/m5253demo/flash.c: In function 'flash_get_offsets':
  board/freescale/m5253demo/flash.c:65:23: warning: iteration 2047u
  invokes undefined behavior [-Waggressive-loop-optimizations]
      info->start[k + 1] = info->start[k] + CONFIG_SYS_SST_SECTSZ;
                         ^
  board/freescale/m5253demo/flash.c:64:3: note: containing loop
     for (k = 0, j = 0; j < CONFIG_SYS_SST_SECT; j++, k++) {
     ^

 ------------------------------8<------------------------------

The cause of the warning is like this:

The for statement iterates 2048 times in flash_get_offsets() func.
(Notice CONFIG_SYS_SST_SECT is defined as 2048)

The last iteration does
  info->start[2048] = info->start[2047] + CONFIG_SYS_SST_SECTSZ;
causing an undefined behavior.

(Please note the array size of info->start is 2048.
CONFIG_SYS_MAX_FLASH_SECT is defined as 2048 for this board.)

This commit fixes that so as not to overrun the info->start array.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jason Jin <Jason.jin@freescale.com>
2014-07-22 09:46:48 -04:00
..
b4860qds powerpc/B4420: Fixed incomplete handling for 0x9d serdes2 2014-06-05 13:45:07 -07:00
bsc9131rdb board/freescale:Remove use of CONFIG_SPL_NAND_MINIMAL 2014-01-02 14:10:13 -08:00
bsc9132qds board/freescale:Remove use of CONFIG_SPL_NAND_MINIMAL 2014-01-02 14:10:13 -08:00
c29xpcie common: Add get_effective_memsize() to memsize.c 2014-02-21 11:06:13 -05:00
common board/freescale: Move CRC32 offset in NXID v1 data format 2014-05-16 16:24:05 -05:00
corenet_ds Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
imx/ddr Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ls2085a ARMv8/ls2085a_emu: Add LS2085A emulator and simulator board support 2014-07-04 19:48:41 +02:00
m547xevb m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m548xevb m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m5208evbe m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m5235evb board: Do not add -DCONFIG_SYS_TEXT_BASE in board config.mk 2013-11-17 14:11:29 -05:00
m5249evb m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m5253demo m68k: fix an undefined behavior warning of M5253DEMO board 2014-07-22 09:46:48 -04:00
m5253evbe m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m5272c3 m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m5275evb m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m5282evb m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m5329evb m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m5373evb m68k: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
m52277evb Makefile: rename all libraries to built-in.o 2013-11-17 14:11:32 -05:00
m53017evb Makefile: rename all libraries to built-in.o 2013-11-17 14:11:32 -05:00
m54418twr board: config.mk: delete unused sinclude directive 2014-03-04 12:15:31 -05:00
m54451evb board: Do not add -DCONFIG_SYS_TEXT_BASE in board config.mk 2013-11-17 14:11:29 -05:00
m54455evb board: Do not add -DCONFIG_SYS_TEXT_BASE in board config.mk 2013-11-17 14:11:29 -05:00
mpc832xemds board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc837xemds board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc837xerdb board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc5121ads board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc7448hpc2 board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8266ads board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8308rdb board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8313erdb board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8315erdb board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8323erdb board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8349emds Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
mpc8349itx board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8360emds board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8360erdk board: powerpc: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mpc8536ds Driver/DDR: combine ccsr_ddr for 83xx, 85xx and 86xx 2013-11-25 11:43:46 -08:00
mpc8540ads Driver/DDR: combine ccsr_ddr for 83xx, 85xx and 86xx 2013-11-25 11:43:46 -08:00
mpc8541cds Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
mpc8544ds Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
mpc8548cds Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
mpc8555cds Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
mpc8560ads Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
mpc8568mds Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
mpc8569mds Driver/DDR: combine ccsr_ddr for 83xx, 85xx and 86xx 2013-11-25 11:43:46 -08:00
mpc8572ds Driver/DDR: combine ccsr_ddr for 83xx, 85xx and 86xx 2013-11-25 11:43:46 -08:00
mpc8610hpcd Driver/DDR: combine ccsr_ddr for 83xx, 85xx and 86xx 2013-11-25 11:43:46 -08:00
mpc8641hpcn Driver/DDR: combine ccsr_ddr for 83xx, 85xx and 86xx 2013-11-25 11:43:46 -08:00
mx6qarm2 mx6qarm2: Remove unneeded error message when cpu_eth_init() fails 2014-01-13 11:52:27 +01:00
mx6qsabreauto mx6sabreauto: Add the mx6dual-lite variant 2014-05-28 17:23:24 +02:00
mx6sabresd mx6sabred: Add PFUZE100 PMIC support 2014-05-28 17:35:39 +02:00
mx6slevk mx6slevk: Add SPI NOR flash support 2014-04-28 14:00:16 +02:00
mx23evk board: arm: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mx25pdk imx: Explicitly pass the I2C bus number in pmic_init() 2013-12-17 16:54:16 +01:00
mx28evk mx28evk: Add documentation on how to boot from SPI NOR 2014-06-17 16:39:10 +02:00
mx31ads mx31ads: Fix the U-Boot binary output 2014-06-11 16:25:39 -04:00
mx31pdk mx31pdk: Fix pmic_init() argument 2013-11-27 09:39:21 +01:00
mx35pdk imx: Explicitly pass the I2C bus number in pmic_init() 2013-12-17 16:54:16 +01:00
mx51evk mx51evk: Fix pmic_init() argument 2013-11-27 09:39:21 +01:00
mx53ard board: arm: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
mx53evk imx: Explicitly pass the I2C bus number in pmic_init() 2013-12-17 16:54:16 +01:00
mx53loco arm: mx5: Avoid hardcoding memory sizes on MX53QSB 2014-03-31 18:28:51 +02:00
mx53smd board: arm: convert makefiles to Kbuild style 2013-11-01 11:42:12 -04:00
p1_p2_rdb board/p1_p2_rdb:Enable p1_p2_rdb boot from NAND/SD/SPI in SPL 2014-05-16 16:24:27 -05:00
p1_p2_rdb_pc common: Add get_effective_memsize() to memsize.c 2014-02-21 11:06:13 -05:00
p1_twr Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
p1010rdb Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx 2014-02-25 13:55:49 -05:00
p1022ds common: Add get_effective_memsize() to memsize.c 2014-02-21 11:06:13 -05:00
p1023rdb Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
p1023rds nand_spl: remove P1023RDS_NAND support 2014-06-05 17:01:58 -04:00
p2020come Driver/DDR: Moving Freescale DDR driver to a common driver 2013-11-25 11:43:43 -08:00
p2020ds Driver/DDR: combine ccsr_ddr for 83xx, 85xx and 86xx 2013-11-25 11:43:46 -08:00
p2041rdb powerpc/mpc85xx:Increase binary size for P, B & T series boards. 2014-01-21 14:06:30 -08:00
qemu-ppce500 PPC 85xx QEMU: Always assume 1 core 2014-05-13 08:26:55 -07:00
t4qds powerpc/t4qds: Add alternate serdes protocols to align with A-007186 2014-06-05 12:55:59 -07:00
t4rdb powerpc/t4rdb: Add alternate serdes protocols to align with A-007186 2014-06-05 12:56:13 -07:00
t104xrdb powerpc/t104xrdb: Toggle deep sleep management signals after resume 2014-05-16 16:24:26 -05:00
t208xqds board/t2080qds: some update for ddr 2014-06-05 12:56:06 -07:00
t208xrdb board/t208x: update t2080qds/t2080rdb for errata A-007186 2014-06-05 12:55:39 -07:00
t1040qds T1040QDS/U-QE: Add u-qe support to t1040qds 2014-04-22 17:58:49 -07:00
vf610twr arm: vf610: Add QSPI support for VF610TWR 2014-06-09 09:18:15 +02:00