From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 27 Jan 2016 07:34:33 +0100 Subject: [U-Boot] [PATCH 1/2] hush: Pull out U-Boot prompt display and read functionality In-Reply-To: <1453866475-6759-1-git-send-email-marex@denx.de> References: <1453866475-6759-1-git-send-email-marex@denx.de> Message-ID: <56A864F9.9030409@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 Hello Marek, Am 27.01.2016 um 04:47 schrieb Marek Vasut: > Pull the code which displays U-Boot prompt and reads the command line > into a separate function. No functional change. > > Signed-off-by: Marek Vasut > --- > common/cli_hush.c | 21 ++++++++++++++++----- > 1 file changed, 16 insertions(+), 5 deletions(-) Reviewed-by: Heiko Schocher bye, Heiko > > diff --git a/common/cli_hush.c b/common/cli_hush.c > index 2fbfdbe..cbaf22e 100644 > --- a/common/cli_hush.c > +++ b/common/cli_hush.c > @@ -974,6 +974,20 @@ static inline void setup_prompt_string(int promptmode, char **prompt_str) > } > #endif > > +#ifdef __U_BOOT__ > +static int uboot_cli_readline(struct in_str *i) > +{ > + char *prompt; > + > + if (i->promptmode == 1) > + prompt = CONFIG_SYS_PROMPT; > + else > + prompt = CONFIG_SYS_PROMPT_HUSH_PS2; > + > + return cli_readline(prompt); > +} > +#endif > + > static void get_user_input(struct in_str *i) > { > #ifndef __U_BOOT__ > @@ -1003,11 +1017,8 @@ static void get_user_input(struct in_str *i) > > bootretry_reset_cmd_timeout(); > i->__promptme = 1; > - if (i->promptmode == 1) { > - n = cli_readline(CONFIG_SYS_PROMPT); > - } else { > - n = cli_readline(CONFIG_SYS_PROMPT_HUSH_PS2); > - } > + n = uboot_cli_readline(i); > + > #ifdef CONFIG_BOOT_RETRY_TIME > if (n == -2) { > puts("\nTimeout waiting for command\n"); > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany