diff mbox

[U-Boot,4/6] autoboot: rename abortboot_{keyed, normal} to __abortboot

Message ID 1466487167-18987-5-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit d8da8298ad9b5a379d6fb7f079a3a1a591147a5e
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada June 21, 2016, 5:32 a.m. UTC
Because abortboot_keyed() and abortboot_normal() are not compiled
at the same time, we can rename both of them to __abortboot().
This allows to drop #ifdef from the caller.

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

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

Comments

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

On 21.06.2016 07:32, Masahiro Yamada wrote:
> Because abortboot_keyed() and abortboot_normal() are not compiled
> at the same time, we can rename both of them to __abortboot().
> This allows to drop #ifdef from 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:
> Because abortboot_keyed() and abortboot_normal() are not compiled
> at the same time, we can rename both of them to __abortboot().
> This allows to drop #ifdef from the caller.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  common/autoboot.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

BTW I suggest _abortboot() - single underscore. But it's not important.
Heiko Schocher June 22, 2016, 5:51 a.m. UTC | #3
Hello Masahiro,

Am 21.06.2016 um 07:32 schrieb Masahiro Yamada:
> Because abortboot_keyed() and abortboot_normal() are not compiled
> at the same time, we can rename both of them to __abortboot().
> This allows to drop #ifdef from the caller.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>   common/autoboot.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)

Thanks!

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

bye,
Heiko
>
> diff --git a/common/autoboot.c b/common/autoboot.c
> index 35deece..eb31c88 100644
> --- a/common/autoboot.c
> +++ b/common/autoboot.c
> @@ -182,7 +182,7 @@ static int passwd_abort(uint64_t etime)
>    * Watch for 'delay' seconds for autoboot stop or autoboot delay string.
>    * returns: 0 -  no key string, allow autoboot 1 - got key string, abort
>    */
> -static int abortboot_keyed(int bootdelay)
> +static int __abortboot(int bootdelay)
>   {
>   	int abort;
>   	uint64_t etime = endtick(bootdelay);
> @@ -216,7 +216,7 @@ static int abortboot_keyed(int bootdelay)
>   static int menukey;
>   #endif
>
> -static int abortboot_normal(int bootdelay)
> +static int __abortboot(int bootdelay)
>   {
>   	int abort = 0;
>   	unsigned long ts;
> @@ -274,11 +274,7 @@ static int abortboot_normal(int bootdelay)
>
>   static int abortboot(int bootdelay)
>   {
> -#ifdef CONFIG_AUTOBOOT_KEYED
> -	return abortboot_keyed(bootdelay);
> -#else
> -	return abortboot_normal(bootdelay);
> -#endif
> +	return __abortboot(bootdelay);
>   }
>
>   static void process_fdt_options(const void *blob)
>
diff mbox

Patch

diff --git a/common/autoboot.c b/common/autoboot.c
index 35deece..eb31c88 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -182,7 +182,7 @@  static int passwd_abort(uint64_t etime)
  * Watch for 'delay' seconds for autoboot stop or autoboot delay string.
  * returns: 0 -  no key string, allow autoboot 1 - got key string, abort
  */
-static int abortboot_keyed(int bootdelay)
+static int __abortboot(int bootdelay)
 {
 	int abort;
 	uint64_t etime = endtick(bootdelay);
@@ -216,7 +216,7 @@  static int abortboot_keyed(int bootdelay)
 static int menukey;
 #endif
 
-static int abortboot_normal(int bootdelay)
+static int __abortboot(int bootdelay)
 {
 	int abort = 0;
 	unsigned long ts;
@@ -274,11 +274,7 @@  static int abortboot_normal(int bootdelay)
 
 static int abortboot(int bootdelay)
 {
-#ifdef CONFIG_AUTOBOOT_KEYED
-	return abortboot_keyed(bootdelay);
-#else
-	return abortboot_normal(bootdelay);
-#endif
+	return __abortboot(bootdelay);
 }
 
 static void process_fdt_options(const void *blob)