Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57528C4332F for ; Mon, 17 Oct 2022 20:32:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1576F84F9F; Mon, 17 Oct 2022 22:30:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="T9NPijYk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 49D6B84F94; Mon, 17 Oct 2022 22:30:33 +0200 (CEST) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3499684F52 for ; Mon, 17 Oct 2022 22:30:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2f.google.com with SMTP id q196so10098325iod.8 for ; Mon, 17 Oct 2022 13:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dCoJrIabH+VLC+cRULqZVHtSfSonpi8cskxiWBEIt2k=; b=T9NPijYkqRVPpG+5ar02CqmyWMahIsJ8KQXlN9G8dqbA7yOwLpdsd62s7gFSHD/Y3V +jNCsHqBspiJwPDmdjmj2bdLjs5wDxWEKRCTodXNS9+aDJbcltyzWQpGIdBbhXl5FQ/f sBn2xSKf9XL44Lr22AW29OnH+NLa54nditm/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dCoJrIabH+VLC+cRULqZVHtSfSonpi8cskxiWBEIt2k=; b=se6mtwt7v0RsypHjtq0PnWX7+5nw1PJhencwPFsF8OjDhIvARR6VXZWK/ttc8Kwvva Fj68rhce/p8T5w3ExmxvJ6REs5fRNg4AMYF513sxHCFcRLwgVxTdDlrsaeSnJFL4pn7M 4stgpEg61x5UeePdOOYsbaXZgt0tGg+rnyJybEmcjmqeILqi/EW/lygoe+sTmYh4HyMT 2hqVLkW6rnZ/8QGZ9MbOZTAWB5FekzK7a0e3R5t288Lz/D4h0dSOk9iiqK0jb2fkpfaR LPo2+aPE0IETzUn1vyIsM839zgmCslrj7ZmI+Vfy9OeP2KaUX7XtBplPw0kuXE5x9QHU wd6w== X-Gm-Message-State: ACrzQf1kfY7hTAAiMehGDpsvpJlr83SRRqR+znY1Whf5pA4cjgv03byy yy6Hp5sdclxfEZhcZJmL7ZMe+em6WY25XA== X-Google-Smtp-Source: AMsMyM5n2hIab2prOSf6oQhRlsC5f/sY9wgONsc649GRWHS/1XUuQqBFKG63nScdty5qZsMXf8bchA== X-Received: by 2002:a6b:cd86:0:b0:6a8:4861:fc2e with SMTP id d128-20020a6bcd86000000b006a84861fc2emr5589228iog.38.1666038617087; Mon, 17 Oct 2022 13:30:17 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:91e:7804:2764:d161]) by smtp.gmail.com with ESMTPSA id j9-20020a926e09000000b002e939413e83sm258071ilc.48.2022.10.17.13.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 13:30:16 -0700 (PDT) From: Simon Glass To: u-boot@lists.denx.de Cc: Anatolij Gustschin , Tom Rini , Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima Subject: [PATCH 04/24] menu: Rename KEY_... to BKEY_... Date: Mon, 17 Oct 2022 14:29:40 -0600 Message-Id: <20221017203000.2207887-5-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221017203000.2207887-1-sjg@chromium.org> References: <20221017203000.2207887-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass --- cmd/bootmenu.c | 10 +++++----- cmd/eficonfig.c | 26 +++++++++++++------------- common/menu.c | 34 +++++++++++++++++----------------- include/menu.h | 32 ++++++++++++++++---------------- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 3340be16325..c80004c54dc 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -86,7 +86,7 @@ static char *bootmenu_choice_entry(void *data) { struct bootmenu_data *menu = data; struct bootmenu_entry *iter; - enum bootmenu_key key = KEY_NONE; + enum bootmenu_key key = BKEY_NONE; int esc = 0; int i; @@ -100,22 +100,22 @@ static char *bootmenu_choice_entry(void *data) } switch (key) { - case KEY_UP: + case BKEY_UP: if (menu->active > 0) --menu->active; /* no menu key selected, regenerate menu */ return NULL; - case KEY_DOWN: + case BKEY_DOWN: if (menu->active < menu->count - 1) ++menu->active; /* no menu key selected, regenerate menu */ return NULL; - case KEY_SELECT: + case BKEY_SELECT: iter = menu->first; for (i = 0; i < menu->active; ++i) iter = iter->next; return iter->key; - case KEY_QUIT: + case BKEY_QUIT: /* Quit by choosing the last entry - U-Boot console */ iter = menu->first; while (iter->next) diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index 2595dd95631..de7ce24f5ac 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -193,31 +193,31 @@ static char *eficonfig_choice_entry(void *data) int esc = 0; struct list_head *pos, *n; struct eficonfig_entry *entry; - enum bootmenu_key key = KEY_NONE; + enum bootmenu_key key = BKEY_NONE; struct efimenu *efi_menu = data; while (1) { bootmenu_loop((struct bootmenu_data *)efi_menu, &key, &esc); switch (key) { - case KEY_UP: + case BKEY_UP: if (efi_menu->active > 0) --efi_menu->active; /* no menu key selected, regenerate menu */ return NULL; - case KEY_DOWN: + case BKEY_DOWN: if (efi_menu->active < efi_menu->count - 1) ++efi_menu->active; /* no menu key selected, regenerate menu */ return NULL; - case KEY_SELECT: + case BKEY_SELECT: list_for_each_safe(pos, n, &efi_menu->list) { entry = list_entry(pos, struct eficonfig_entry, list); if (entry->num == efi_menu->active) return entry->key; } break; - case KEY_QUIT: + case BKEY_QUIT: /* Quit by choosing the last entry */ entry = list_last_entry(&efi_menu->list, struct eficonfig_entry, list); return entry->key; @@ -1864,14 +1864,14 @@ static efi_status_t eficonfig_choice_change_boot_order(struct efimenu *efi_menu) int esc = 0; struct list_head *pos, *n; struct eficonfig_boot_order *tmp; - enum bootmenu_key key = KEY_NONE; + enum bootmenu_key key = BKEY_NONE; struct eficonfig_boot_order *entry; while (1) { bootmenu_loop(NULL, &key, &esc); switch (key) { - case KEY_PLUS: + case BKEY_PLUS: if (efi_menu->active > 0) { list_for_each_safe(pos, n, &efi_menu->list) { entry = list_entry(pos, struct eficonfig_boot_order, list); @@ -1885,11 +1885,11 @@ static efi_status_t eficonfig_choice_change_boot_order(struct efimenu *efi_menu) list_add(&tmp->list, &entry->list); } fallthrough; - case KEY_UP: + case BKEY_UP: if (efi_menu->active > 0) --efi_menu->active; return EFI_NOT_READY; - case KEY_MINUS: + case BKEY_MINUS: if (efi_menu->active < efi_menu->count - 3) { list_for_each_safe(pos, n, &efi_menu->list) { entry = list_entry(pos, struct eficonfig_boot_order, list); @@ -1905,11 +1905,11 @@ static efi_status_t eficonfig_choice_change_boot_order(struct efimenu *efi_menu) ++efi_menu->active; } return EFI_NOT_READY; - case KEY_DOWN: + case BKEY_DOWN: if (efi_menu->active < efi_menu->count - 1) ++efi_menu->active; return EFI_NOT_READY; - case KEY_SELECT: + case BKEY_SELECT: /* "Save" */ if (efi_menu->active == efi_menu->count - 2) return EFI_SUCCESS; @@ -1919,7 +1919,7 @@ static efi_status_t eficonfig_choice_change_boot_order(struct efimenu *efi_menu) return EFI_ABORTED; break; - case KEY_SPACE: + case BKEY_SPACE: if (efi_menu->active < efi_menu->count - 2) { list_for_each_safe(pos, n, &efi_menu->list) { entry = list_entry(pos, struct eficonfig_boot_order, list); @@ -1930,7 +1930,7 @@ static efi_status_t eficonfig_choice_change_boot_order(struct efimenu *efi_menu) } } break; - case KEY_QUIT: + case BKEY_QUIT: return EFI_ABORTED; default: /* Pressed key is not valid, no need to regenerate the menu */ diff --git a/common/menu.c b/common/menu.c index 0d19601cf53..087e4c246e2 100644 --- a/common/menu.c +++ b/common/menu.c @@ -446,16 +446,16 @@ void bootmenu_autoboot_loop(struct bootmenu_data *menu, switch (c) { case '\e': *esc = 1; - *key = KEY_NONE; + *key = BKEY_NONE; break; case '\r': - *key = KEY_SELECT; + *key = BKEY_SELECT; break; case 0x3: /* ^C */ - *key = KEY_QUIT; + *key = BKEY_QUIT; break; default: - *key = KEY_NONE; + *key = BKEY_NONE; break; } @@ -471,7 +471,7 @@ void bootmenu_autoboot_loop(struct bootmenu_data *menu, printf(ANSI_CURSOR_POSITION ANSI_CLEAR_LINE, menu->count + 5, 1); if (menu->delay == 0) - *key = KEY_SELECT; + *key = BKEY_SELECT; } void bootmenu_loop(struct bootmenu_data *menu, @@ -503,17 +503,17 @@ void bootmenu_loop(struct bootmenu_data *menu, /* First char of ANSI escape sequence '\e' */ if (c == '\e') { *esc = 1; - *key = KEY_NONE; + *key = BKEY_NONE; } break; case 1: /* Second char of ANSI '[' */ if (c == '[') { *esc = 2; - *key = KEY_NONE; + *key = BKEY_NONE; } else { /* Alone ESC key was pressed */ - *key = KEY_QUIT; + *key = BKEY_QUIT; *esc = (c == '\e') ? 1 : 0; } break; @@ -522,7 +522,7 @@ void bootmenu_loop(struct bootmenu_data *menu, /* Third char of ANSI (number '1') - optional */ if (*esc == 2 && c == '1') { *esc = 3; - *key = KEY_NONE; + *key = BKEY_NONE; break; } @@ -530,31 +530,31 @@ void bootmenu_loop(struct bootmenu_data *menu, /* ANSI 'A' - key up was pressed */ if (c == 'A') - *key = KEY_UP; + *key = BKEY_UP; /* ANSI 'B' - key down was pressed */ else if (c == 'B') - *key = KEY_DOWN; + *key = BKEY_DOWN; /* other key was pressed */ else - *key = KEY_NONE; + *key = BKEY_NONE; break; } /* enter key was pressed */ if (c == '\r') - *key = KEY_SELECT; + *key = BKEY_SELECT; /* ^C was pressed */ if (c == 0x3) - *key = KEY_QUIT; + *key = BKEY_QUIT; if (c == '+') - *key = KEY_PLUS; + *key = BKEY_PLUS; if (c == '-') - *key = KEY_MINUS; + *key = BKEY_MINUS; if (c == ' ') - *key = KEY_SPACE; + *key = BKEY_SPACE; } diff --git a/include/menu.h b/include/menu.h index 0b4d9734149..29b457921e9 100644 --- a/include/menu.h +++ b/include/menu.h @@ -44,14 +44,14 @@ struct bootmenu_data { /** enum bootmenu_key - keys that can be returned by the bootmenu */ enum bootmenu_key { - KEY_NONE = 0, - KEY_UP, - KEY_DOWN, - KEY_SELECT, - KEY_QUIT, - KEY_PLUS, - KEY_MINUS, - KEY_SPACE, + BKEY_NONE = 0, + BKEY_UP, + BKEY_DOWN, + BKEY_SELECT, + BKEY_QUIT, + BKEY_PLUS, + BKEY_MINUS, + BKEY_SPACE, }; /** @@ -85,14 +85,14 @@ void bootmenu_autoboot_loop(struct bootmenu_data *menu, * * @menu: Menu being processed * @key: Returns the code for the key the user pressed: - * enter: KEY_SELECT - * Ctrl-C: KEY_QUIT - * Up arrow: KEY_UP - * Down arrow: KEY_DOWN - * Escape (by itself): KEY_QUIT - * Plus: KEY_PLUS - * Minus: KEY_MINUS - * Space: KEY_SPACE + * enter: BKEY_SELECT + * Ctrl-C: BKEY_QUIT + * Up arrow: BKEY_UP + * Down arrow: BKEY_DOWN + * Escape (by itself): BKEY_QUIT + * Plus: BKEY_PLUS + * Minus: BKEY_MINUS + * Space: BKEY_SPACE * @esc: On input, a non-zero value indicates that an escape sequence has * resulted in that many characters so far. On exit this is updated to the * new number of characters -- 2.38.0.413.g74048e4d9e-goog