From: Wolfgang Denk Date: Sun, 03 Jan 2010 00:50:18 +0100 Subject: [U-Boot] [PATCH] Make getenv_IPaddr() global In-Reply-To: References: <1262183780-17758-1-git-send-email-dirk.behme@googlemail.com> Message-ID: <20100102235018.E789DE34A26@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Ben, In message 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 ? 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 An expert is a person who avoids the small errors while sweeping on to the grand fallacy.