zipl/boot: Change error codes to enums

Change error codes returned from menu_param to enums.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Richie Buturla <richie@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Richie Buturla
2025-08-22 17:53:48 +02:00
committed by Jan Höppner
parent 35d68b2101
commit 4a9f66fc31
2 changed files with 9 additions and 7 deletions

View File

@@ -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 */

View File

@@ -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;