From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Change env_get_char from a global function ptr to a function.
Date: Sun, 30 Mar 2008 20:08:47 +0200 [thread overview]
Message-ID: <20080330180847.GA31958@game.jcrosoft.org> (raw)
In-Reply-To: <1206719159-11200-2-git-send-email-Joakim.Tjernlund@transmode.se>
On 16:45 Fri 28 Mar , Joakim Tjernlund wrote:
> This avoids an early global data reference.
>
> ---
> I hope this still applies.
>
> api/api.c | 1 -
> common/cmd_bootm.c | 3 ---
> common/cmd_nvedit.c | 3 ---
> common/env_common.c | 21 +++++++++++++++------
> common/env_eeprom.c | 1 -
> common/env_nvram.c | 1 -
> common/fdt_support.c | 4 ----
> common/ft_build.c | 3 ---
> include/common.h | 1 +
> 9 files changed, 16 insertions(+), 22 deletions(-)
>
> diff --git a/api/api.c b/api/api.c
> index 0598d90..c1b2b60 100644
> --- a/api/api.c
> +++ b/api/api.c
> @@ -40,7 +40,6 @@
>
> /* U-Boot routines needed */
> extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
> -extern uchar (*env_get_char)(int);
> extern uchar *env_get_addr(int);
>
> /*****************************************************************************
> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index 9546729..5062817 100644
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
> @@ -1150,9 +1150,6 @@ do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
>
> #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
>
> -/* Function that returns a character from the environment */
> -extern uchar (*env_get_char)(int);
> -
> static void
> do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
> int argc, char *argv[],
> diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
> index dd263b6..15dca5b 100644
> --- a/common/cmd_nvedit.c
> +++ b/common/cmd_nvedit.c
> @@ -68,9 +68,6 @@ DECLARE_GLOBAL_DATA_PTR;
> /************************************************************************
> ************************************************************************/
>
> -/* Function that returns a character from the environment */
> -extern uchar (*env_get_char)(int);
> -
> /* Function that returns a pointer to a value from the environment */
> /* (Only memory version supported / needed). */
> extern uchar *env_get_addr(int);
> diff --git a/common/env_common.c b/common/env_common.c
> index a494812..e87818b 100644
> --- a/common/env_common.c
> +++ b/common/env_common.c
> @@ -50,7 +50,6 @@ extern void env_relocate_spec (void);
> extern uchar env_get_char_spec(int);
>
> static uchar env_get_char_init (int index);
> -uchar (*env_get_char)(int) = env_get_char_init;
>
> /************************************************************************
> * Default settings to be used when no valid environment is found
> @@ -182,6 +181,21 @@ uchar env_get_char_memory (int index)
> }
> #endif
>
> +uchar env_get_char (int index)
> +{
> + uchar c;
> +
> + /* if relocated to RAM */
> + if (gd->flags & GD_FLG_RELOC)
> + {
> + c = env_get_char_memory(index);
> + } else {
> + c = env_get_char_init(index);
> + }
Please remove occolade
Best Regards,
J.
next prev parent reply other threads:[~2008-03-30 18:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 15:45 [U-Boot-Users] [PATCH] Move init_sequence table into code Joakim Tjernlund
2008-03-28 15:45 ` [U-Boot-Users] [PATCH] Change env_get_char from a global function ptr to a function Joakim Tjernlund
2008-03-30 18:08 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2008-03-30 20:59 ` Wolfgang Denk
2008-03-30 21:05 ` Joakim Tjernlund
2008-03-30 22:33 ` Wolfgang Denk
2008-03-31 7:15 ` Joakim Tjernlund
2008-04-05 17:31 ` Joakim Tjernlund
2008-04-14 1:09 ` Wolfgang Denk
2008-04-14 21:01 ` Joakim Tjernlund
2008-04-18 4:14 ` Wolfgang Denk
2008-04-14 1:09 ` [U-Boot-Users] [PATCH] Move init_sequence table into code Wolfgang Denk
2008-04-14 21:06 ` Joakim Tjernlund
2008-04-15 4:35 ` Wolfgang Denk
2008-04-15 6:40 ` Joakim Tjernlund
2008-04-18 4:14 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080330180847.GA31958@game.jcrosoft.org \
--to=plagnioj@jcrosoft.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox