[U-Boot] [PATCH 2/3] mpc83xx: mpc8360emds - fix gcc 4.6 compiler warning

Wolfgang Denk wd at denx.de
Wed Nov 16 21:41:40 CET 2011


Dear Kim Phillips,

In message <1321433993-2488-2-git-send-email-kim.phillips at freescale.com> you wrote:
> Configuring for MPC8360EMDS_66_HOST_33 - Board: MPC8360EMDS, Options: CLKIN_66MHZ,PCI,PCI_33M,PQ_MDS_PIB=1
> mpc8360emds.c: In function 'board_eth_init':
> mpc8360emds.c:178:12: warning: array subscript is above array bounds [-Warray-bounds]
> 
> Signed-off-by: Kim Phillips <kim.phillips at freescale.com>
> ---
>  board/freescale/mpc8360emds/mpc8360emds.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c
> index be76774..bdd1293 100644
> --- a/board/freescale/mpc8360emds/mpc8360emds.c
> +++ b/board/freescale/mpc8360emds/mpc8360emds.c
> @@ -172,10 +172,11 @@ int board_eth_init(bd_t *bd)
>  	if (board_handle_erratum2()) {
>  		int i;
>  
> -		for (i = 0; i < ARRAY_SIZE(uec_info); i++)
> +		for (i = 0; i < ARRAY_SIZE(uec_info); i++) {
>  			uec_info[i].enet_interface_type =
>  				PHY_INTERFACE_MODE_RGMII_RXID;
>  			uec_info[i].speed = SPEED_1000;
> +		}
>  	}
>  	return uec_eth_init(bd, uec_info, ARRAY_SIZE(uec_info));

Seems we caught a real error here?  Great!  Thanks!


Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There is a biblical analogy I'd like to draw here.   Casts are to C++
Programmers what the apple was to Eve.         - Scott Douglas Meyers


More information about the U-Boot mailing list