[U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash

Wolfgang Denk wd at denx.de
Tue Aug 2 18:23:42 CEST 2011


Dear nagabhushana.netagunte at ti.com,

In message <1312299792-16415-6-git-send-email-nagabhushana.netagunte at ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte at ti.com>
> 
> add misc_int_r function to read the mac address from SPI flash
> if env variable ethaddr is not set.
> 
> Signed-off-by: Prakash PM <prakash.pm at ti.com>
> Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte at ti.com>
...
> +err_read:
> +	/* cannot call free currently since the free function calls free() for
> +	 * spi_flash structure though it is not directly allocated through
> +	 * malloc()
> +	 */

Incorrect multiline comment style.

> +int misc_init_r(void)
> +{
> +	uint8_t addr[10];
> +	uchar enetaddr[6];
> +	int ret;
> +
> +	printf("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));

Please do not add unneeded output to the a;lways printed boot
messages.  If you want tto provide this information to the user then
add it as part of the "clock" command.

> +		sprintf((char *)enetaddr, "%02x:%02x:%02x:%02x:%02x:%02x",
> +			addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);

Why don't you simply use "%pM" here?


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
The flow chart is a most thoroughly oversold piece of  program  docu-
mentation.              -- Frederick Brooks, "The Mythical Man Month"


More information about the U-Boot mailing list