On Monday 16 February 2009 17:46:24 Wolfgang Denk wrote:
> In message Mike Frysinger wrote:
> > The boards that get converted here to use the environment for the mac
> > address rather than global data:
>
> Hmm... is this commit message correct? Makes little sense to me....

looks correct to me ... the boards are moved from using the global data to 
using the environment

> > diff --git a/board/etin/debris/debris.c b/board/etin/debris/debris.c
> > index 227c49a..3dec7cc 100644
> > --- a/board/etin/debris/debris.c
> > +++ b/board/etin/debris/debris.c
> > @@ -174,8 +174,10 @@ void nvram_write(long dest, const void *src, size_t
> > count) int misc_init_r(void)
> >  {
> >     /* Write ethernet addr in NVRAM for VxWorks */
> > -   nvram_write(CONFIG_ENV_ADDR + CONFIG_SYS_NVRAM_VXWORKS_OFFS,
> > -                   (char*)&gd->bd->bi_enetaddr[0], 6);
> > +   uchar ethaddr[6];
> > +   if (eth_getenv_enetaddr("ethaddr", ethaddr))
>
> Please move declaration above comment (and add an empty line).

ok

> > -static int get_mac_address (int id, u8 * mac, char *string, int size)
> > +static int get_mac_address (int id, u8 *mac)
> >  {
> > -   if (size < 6 * 3)
> > -           return -1;
> > -
> >     i2155x_read_vpd (I2155X_VPD_MAC0_START + 6 * id, 6, mac);
> > -   return sprintf (string, "%02x:%02x:%02x:%02x:%02x:%02x",
> > -                           mac[0], mac[1], mac[2],
> > -                           mac[3], mac[4], mac[5]);
> >  }
>
> This one looks broken to me. At least it returns random data.

yes, i broke the return value.  not that it would make a difference at runtime 
as nowhere was the return value actually checked/used.  fixed though, thanks.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to