Dear Kumar Gala,

In message <[EMAIL PROTECTED]> you wrote:
> Move to using the environment variables 'ethaddr', 'eth1addr', etc..
> instead of bd->bi_enetaddr, bi_enet1addr, etc.
> 
> This makes the code a bit more flexible to the number of ethernet
> interfaces.
> 
> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
> ---
> 
> Iterate over the aliases since its simplier than inventing a wheel to
> iterate over the environment.  This removes the hard coded limit.

Please iterate over the environment variables as discussed earlier.

I don't think there is any need to invent wheels to iterate over the
environment. It should probably be as simple as that:

        char mac[16];
        char *val;
        int i = 0;

        strcpy (mac, "ethaddr");

        while ((val = getenv(mac)) != NULL) {
                ...
                sprintf (mac, "eth%daddr", ++i);
        }

I call that a loop, not a wheel :-)

> +     sprintf(mac, idx ? "eth%daddr" : "ethaddr", idx);

That should generate a nasty compiler warning about number of
arguments ...


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: [EMAIL PROTECTED]
War is never imperative.
        -- McCoy, "Balance of Terror", stardate 1709.2
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to