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 BD845C433FE for ; Tue, 4 Oct 2022 14:35:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 51C3984D5C; Tue, 4 Oct 2022 16:35:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="MzZVL0oj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B479284D5C; Tue, 4 Oct 2022 16:35:29 +0200 (CEST) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 B174084D3D for ; Tue, 4 Oct 2022 16:35:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pl1-x62d.google.com with SMTP id f23so12831355plr.6 for ; Tue, 04 Oct 2022 07:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date; bh=dysblzSqAwPzdIh4hR4QLLUToYZULRuJDPwRm1zxtXQ=; b=MzZVL0ojkVqAFZewxhxGNXL3Zlnoa0zhY46CtVcsq8kU+mnP666kalLa1HO2Wr5Gf/ ITysl9wwwL2FaMoWAoXW7ov9DAgcuUzADVk5Kp9dg0f068JAnYopuN45itGo1NTbepXq BG9KiGOTnT+iqZHE5JkbIPpYzuhlBj5rkYH+yTFF+XzQ2wslfl9IwCDUG1qxum+/LK66 gAZUP8IkLH0M3K2H3Ad6okLqOBBpvzf24fvdn3rCcDSa29FNmOcZfpTbWX3L7+58Jkjz t6710vJbYqw30Piov4ok0ofBeijuOyKLxNytBeQHb+1PZd+h4n/HzVyvjLvIiVBxlhKB OTNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=dysblzSqAwPzdIh4hR4QLLUToYZULRuJDPwRm1zxtXQ=; b=AObLOW19l3B+F8prZOGQcPhDd0Ja3KslZMK41DYDhpR0LzoQbW9JLQEEL33vfkdPst uk9z9AY619mOlgkRPEyI3qQndzMa4eFYc09t0ePbhC9vxR6LJZEQTNpA96ushVSbzrJO QRgVoZ6X+7Uhgoxgpxc7lxZGmbde7SOv/x7y/nRAAn54T3Kp/G14WuOW743HW1YE1og9 HBMCpqbQPCDMsGXJO9a75qURqI0/q49hy1soJUeeq6TgViy41BKgcCAoc/MAHKm/avt3 3ew1tde020Q1JzBGq81JcbcMySDqdW5DvNz/cO97XBKB19du7aCsNfjXN9jsocEvXF6v dmhg== X-Gm-Message-State: ACrzQf3RrSmD0psGmwm3u3Fg+pquXOF4LK6nyi8cLYd/y+Y+D/l5fKQ2 /kN4qjTccnKDYlFpKYuagTCXiSQzXzazxw== X-Google-Smtp-Source: AMsMyM6QyCQQYdSRztCyRi5AfNajPf7OYzn32VxJDsd/CRIRTRZzh+CLah0QX6sj37qJO+DrOwlN/Q== X-Received: by 2002:a17:90b:4c03:b0:20a:919d:44a3 with SMTP id na3-20020a17090b4c0300b0020a919d44a3mr82289pjb.146.1664894124652; Tue, 04 Oct 2022 07:35:24 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id u6-20020a170902e80600b001783a917b9asm9044119plg.127.2022.10.04.07.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 07:35:24 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Masahisa Kojima Subject: [PATCH v2 1/6] eficonfig: refactor eficonfig_select_file_handler() Date: Tue, 4 Oct 2022 23:35:37 +0900 Message-Id: <20221004143543.30000-2-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221004143543.30000-1-masahisa.kojima@linaro.org> References: <20221004143543.30000-1-masahisa.kojima@linaro.org> 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 eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() intends to add the additional menu mainly to clear the selected file information. eficonfig_display_select_file_option() is not necessary for the file selection process, so it should be outside of eficonfig_select_file_handler(). Signed-off-by: Masahisa Kojima --- newly created in v2 cmd/eficonfig.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index 2595dd9563..f6a99bd01a 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -968,7 +968,7 @@ efi_status_t eficonfig_process_clear_file_selection(void *data) } static struct eficonfig_item select_file_menu_items[] = { - {"Select File", eficonfig_process_select_file}, + {"Select File", eficonfig_select_file_handler}, {"Clear", eficonfig_process_clear_file_selection}, {"Quit", eficonfig_process_quit}, }; @@ -980,12 +980,13 @@ static struct eficonfig_item select_file_menu_items[] = { * @file_info: pointer to the file information structure * Return: status code */ -efi_status_t eficonfig_display_select_file_option(struct eficonfig_select_file_info *file_info) +efi_status_t eficonfig_display_select_file_option(void *data) { efi_status_t ret; struct efimenu *efi_menu; - select_file_menu_items[1].data = file_info; + select_file_menu_items[0].data = data; + select_file_menu_items[1].data = data; efi_menu = eficonfig_create_fixed_menu(select_file_menu_items, ARRAY_SIZE(select_file_menu_items)); if (!efi_menu) @@ -1016,10 +1017,6 @@ efi_status_t eficonfig_select_file_handler(void *data) struct eficonfig_select_file_info *tmp = NULL; struct eficonfig_select_file_info *file_info = data; - ret = eficonfig_display_select_file_option(file_info); - if (ret != EFI_SUCCESS) - return ret; - tmp = calloc(1, sizeof(struct eficonfig_select_file_info)); if (!tmp) return EFI_OUT_OF_RESOURCES; @@ -1284,7 +1281,7 @@ static efi_status_t prepare_file_selection_entry(struct efimenu *efi_menu, char utf8_utf16_strcpy(&p, devname); u16_strlcat(file_name, file_info->current_path, len); ret = create_boot_option_entry(efi_menu, title, file_name, - eficonfig_select_file_handler, file_info); + eficonfig_display_select_file_option, file_info); out: free(devname); free(file_name); -- 2.17.1