[U-Boot] [PATCH 1/4] sunxi: Fix build when CONFIG_CMD_NET is disabled

Tomas Novotny tomas at novotny.cz
Mon Feb 11 12:14:10 UTC 2019


Hi Ondřej,

On Sat,  9 Feb 2019 14:39:54 +0100, megous at megous.com <megous at megous.com>
wrote:
> From: Ondrej Jirman <megous at megous.com>
> 
> Signed-off-by: Ondřej Jirman <megous at megous.com>
> ---
>  board/sunxi/board.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> index 98bc3cd0c1..e918bdf36b 100644
> --- a/board/sunxi/board.c
> +++ b/board/sunxi/board.c
> @@ -774,9 +774,12 @@ static void setup_environment(const void *fdt)
>  {
>  	char serial_string[17] = { 0 };
>  	unsigned int sid[4];
> +#if defined CONFIG_CMD_NET
>  	uint8_t mac_addr[6];
>  	char ethaddr[16];
> -	int i, ret;
> +	int i;
> +#endif
> +	int ret;
>  
>  	ret = sunxi_get_sid(sid);
>  	if (ret == 0 && sid[0] != 0) {
> @@ -801,6 +804,7 @@ static void setup_environment(const void *fdt)
>  		if ((sid[3] & 0xffffff) == 0)
>  			sid[3] |= 0x800000;
>  
> +#if defined CONFIG_CMD_NET
>  		for (i = 0; i < 4; i++) {
>  			sprintf(ethaddr, "ethernet%d", i);
>  			if (!fdt_get_alias(fdt, ethaddr))
> @@ -824,6 +828,7 @@ static void setup_environment(const void *fdt)
>  
>  			eth_env_set_enetaddr(ethaddr, mac_addr);
>  		}
> +#endif
>  
>  		if (!env_get("serial#")) {
>  			snprintf(serial_string, sizeof(serial_string),

This patch is not needed anymore. We had a similar one also in 2018.03, but
after 2019.01 upgrade it wasn't needed. It was fixed in Apr-2018:
9925f1dbc38c:
net: Move enetaddr env access code to env config instead of net config

Tomas


More information about the U-Boot mailing list