diff --git a/zipl/boot/menu.c b/zipl/boot/menu.c index 8958f612..48cbf73e 100644 --- a/zipl/boot/menu.c +++ b/zipl/boot/menu.c @@ -98,6 +98,12 @@ static int menu_list(void) return 0; } +enum param_result { + NUMBER_FOUND = 0, + PRINT_PROMPT = 1, + NOTHING_FOUND = 2, +}; + /* * Interpret loadparm * @@ -109,7 +115,7 @@ static int menu_list(void) * 1 - print prompt * 2 - nothing found */ -static int menu_param(unsigned long *value) +static enum param_result menu_param(unsigned long *value) { char loadparm[PARAM_SIZE]; char *endptr; @@ -152,10 +158,10 @@ int menu(void) goto boot; rc = menu_param(&value); - if (rc == 0) { + if (rc == NUMBER_FOUND) { /* got number from loadparm, boot it */ goto boot; - } else if (rc == 1 && value == 0) { + } else if (rc == PRINT_PROMPT && value == 0) { /* keyword "prompt", show menu */ } else if (__stage2_params.flag == 0) { /* menu disabled, boot default */ diff --git a/zipl/boot/menu.h b/zipl/boot/menu.h index c6d688c1..3388f6fa 100644 --- a/zipl/boot/menu.h +++ b/zipl/boot/menu.h @@ -18,10 +18,6 @@ #define PARAM_SIZE 8 #define TEXT_OFFSET 4 -#define NUMBER_FOUND 0 -#define PRINT_PROMPT 1 -#define NOTHING_FOUND 2 - struct boot_stage2_params { uint16_t flag; uint16_t timeout;