diff mbox

[U-Boot,5/6] autoboot: move CONFIG_SILENT_CONSOLE handling

Message ID 1466487167-18987-6-git-send-email-yamada.masahiro@socionext.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada June 21, 2016, 5:32 a.m. UTC
Factor out the same code from the callees to the caller.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 common/autoboot.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

Comments

Stefan Roese June 21, 2016, 5:46 a.m. UTC | #1
Hi Masahiro,

On 21.06.2016 07:32, Masahiro Yamada wrote:
> Factor out the same code from the callees to the caller.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
Simon Glass June 21, 2016, 4:06 p.m. UTC | #2
On 20 June 2016 at 23:32, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> Factor out the same code from the callees to the caller.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  common/autoboot.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Heiko Schocher June 22, 2016, 5:51 a.m. UTC | #3
Hello Masahiro,

Am 21.06.2016 um 07:32 schrieb Masahiro Yamada:
> Factor out the same code from the callees to the caller.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>   common/autoboot.c | 21 ++++++++++-----------
>   1 file changed, 10 insertions(+), 11 deletions(-)

Thanks!

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/common/autoboot.c b/common/autoboot.c
> index eb31c88..2d19104 100644
> --- a/common/autoboot.c
> +++ b/common/autoboot.c
> @@ -202,11 +202,6 @@ static int __abortboot(int bootdelay)
>   	if (!abort)
>   		debug_bootkeys("key timeout\n");
>
> -#ifdef CONFIG_SILENT_CONSOLE
> -	if (abort)
> -		gd->flags &= ~GD_FLG_SILENT;
> -#endif
> -
>   	return abort;
>   }
>
> @@ -263,18 +258,22 @@ static int __abortboot(int bootdelay)
>
>   	putc('\n');
>
> -#ifdef CONFIG_SILENT_CONSOLE
> -	if (abort)
> -		gd->flags &= ~GD_FLG_SILENT;
> -#endif
> -
>   	return abort;
>   }
>   # endif	/* CONFIG_AUTOBOOT_KEYED */
>
>   static int abortboot(int bootdelay)
>   {
> -	return __abortboot(bootdelay);
> +	int ret;
> +
> +	ret = __abortboot(bootdelay);
> +
> +#ifdef CONFIG_SILENT_CONSOLE
> +	if (abort)
> +		gd->flags &= ~GD_FLG_SILENT;
> +#endif
> +
> +	return ret;
>   }
>
>   static void process_fdt_options(const void *blob)
>
diff mbox

Patch

diff --git a/common/autoboot.c b/common/autoboot.c
index eb31c88..2d19104 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -202,11 +202,6 @@  static int __abortboot(int bootdelay)
 	if (!abort)
 		debug_bootkeys("key timeout\n");
 
-#ifdef CONFIG_SILENT_CONSOLE
-	if (abort)
-		gd->flags &= ~GD_FLG_SILENT;
-#endif
-
 	return abort;
 }
 
@@ -263,18 +258,22 @@  static int __abortboot(int bootdelay)
 
 	putc('\n');
 
-#ifdef CONFIG_SILENT_CONSOLE
-	if (abort)
-		gd->flags &= ~GD_FLG_SILENT;
-#endif
-
 	return abort;
 }
 # endif	/* CONFIG_AUTOBOOT_KEYED */
 
 static int abortboot(int bootdelay)
 {
-	return __abortboot(bootdelay);
+	int ret;
+
+	ret = __abortboot(bootdelay);
+
+#ifdef CONFIG_SILENT_CONSOLE
+	if (abort)
+		gd->flags &= ~GD_FLG_SILENT;
+#endif
+
+	return ret;
 }
 
 static void process_fdt_options(const void *blob)