[U-Boot] [PATCH] Make getenv_IPaddr() global
Ben Warren
biggerbadderben at gmail.com
Sun Jan 3 04:09:29 CET 2010
Hi Wolfgang and Happy New Year to all,
On Sat, Jan 2, 2010 at 3:50 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Ben,
>
> In message <f8328f7c0912301331m7ae655c0ke6891526776cf0c3 at mail.gmail.com>
> you wrote:
> >
> > > We should not make the passing of the IP configuration to Linux
> > > dependent on U-Boot features / settings.
> > >
> > > For this, make getenv_IPaddr() global. This fixes build error
> > >
> > > u-boot/lib_xxx/board.c:360: undefined reference to `getenv_IPaddr'
> ...
>
> > I agree that this function should be generic, but it's more of an
> > environment function than a networking one. Why not put this somewhere
> like
> > common/env_common.c or create a new file called common/env_net.c?
>
> After re-thinking what I wrote before, I still think that lib_generic/
> is the right place. The code defines two functions:
>
> IPaddr_t string_to_ip(char *s)
> and
> IPaddr_t getenv_IPaddr (char *var)
>
> The former does all the actual work and has nothing to do with
> environment things, and the latter should eventually be moved as a
> "static inline" to some header file.
>
> I'm not sure how to interpret your comment - was it just a question,
> or was it intended to be a NAK ?
>
> Not a firm NAK, I'm just not a fan of creating a new file for a single
function. The important thing is that the code gets linked in to
everything, and both solutions fit that requirement.
> Best regards,
>
> Wolfgang Denk
>
> regards,
Ben
More information about the U-Boot
mailing list