From patchwork Fri Oct 14 06:56:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 615060 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp112835pvb; Thu, 13 Oct 2022 23:57:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4feGmWNLMeca4YB2SVpD7XTnmjgcceT/YwZb79Sjlv/oINWlC2BkIaG+xvfVp5SjoXZIC9 X-Received: by 2002:a05:6402:847:b0:453:944a:ba8e with SMTP id b7-20020a056402084700b00453944aba8emr3019869edz.326.1665730659816; Thu, 13 Oct 2022 23:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665730659; cv=none; d=google.com; s=arc-20160816; b=jMYA2epooG74MDzIcJMqf3+zWGVYBtd/RuA52d4DF6yI9mb7tlY5TGAIgWLIZ0nuz/ OHIIdmPxctdtarvr66QldcGnkXPv1Lsb7ICQkf2468iajMLFsATS7uevSPIcDam1xys2 6QdGcLjvAQfaP78dFBiUNMUoc/Jw0XdSMLaxLkr7mCVBRpoev18w7en2e6Q0T4CgFilZ dGagOp9VP1MMDJ1NE3Ik1dtfcrJBiTwuiAeEnTc+On+38qZRMQ7VRnPYaRlVXl2bzgj8 0KQTzM7w8ODMttAHtKDzQztu+Ac0qJQrjMXM3/Tii6LtLFKjYs11eetumgVzXhnzwgrn COjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Nc0Nv7HUBnTNid2FRKN6ahbG6U5vKFhetxIRWUXbksE=; b=lhVjkEG5JElTNpj6c76K5tKBQoS8IRp/IPnFM1GoZfRsKRyVBeOG1bHLWigHJZJ40y oLzJnoK9vmt/ld8dwRWa8oPJNwfFiziaqZ4t1mJLesMWjqj1jzHJ85q2fkXe3SfEAcxv 8OkqOYunYZiTeTdbvZ170iIXDLe/h+/Ch2WysYD0P92Bzs7bxPMZFI4TyB1yqhGuCwEE JzQPs5I9XzrpWId68ayZNAGVvplpXo+lf6MEk6EbXoUz11Mao/6cghvbvBEx3TTi+a0O DCLJ9RHF4M/zHHOqqdlG+Yb35p1+oF9HxUn8k1Pm0jP8E8VXD6uJc4wqPlC9MjNwdm9T adIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NNkiDrwC; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id r23-20020a170906365700b0077951929341si1490812ejb.312.2022.10.13.23.57.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 23:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NNkiDrwC; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7015D84F1C; Fri, 14 Oct 2022 08:57:38 +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="NNkiDrwC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B164084F26; Fri, 14 Oct 2022 08:57:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (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 E1D1784EF9 for ; Fri, 14 Oct 2022 08:57:28 +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-pj1-x1035.google.com with SMTP id n18-20020a17090ade9200b0020b0012097cso7388385pjv.0 for ; Thu, 13 Oct 2022 23:57:28 -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:message-id:reply-to; bh=Nc0Nv7HUBnTNid2FRKN6ahbG6U5vKFhetxIRWUXbksE=; b=NNkiDrwC8f05TyQa49DDGioNcjXwaNxpLUaj8z50sl64i4RZRa/z1qDWV9zcRDQJJ1 WJEZDqOdxek4NiqhI3WFXimGTS2qomGacHZW58hG0AVbSUaOuUNkB4TudDmaMm3zlmBM hw/MAk9Z0TbrmmnWILCJ395nl0WycSWXWQOSmOmv20V2S/ydMH5eH3LtVV4kG/+SA7AY P6ypOPWtmwdBptKhjT1UFK641WKPkbLwtOyNAAALg2Y+PL7gdukZIWS5B9xeiOkeTICI OvtMH9d1eRQL2riKYX5VXWEWjCup0UbFuidMRAXNLXt6RCX6VLNFtWsL4rdv+e7ukGQM oKEA== 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:message-id:reply-to; bh=Nc0Nv7HUBnTNid2FRKN6ahbG6U5vKFhetxIRWUXbksE=; b=h7qRw2One0fjbvMyl4mxR122ow+mxM3NwyQl+R03dnGNwL/38oYd5e1K5cLrgEh5JN L2tY2zjkIz1XMRkAOJeAmiSARnaPb8d8tC/11Xta9eBDFszeujqigcgPIMC/YDkrtc85 9AEKssdQG+iiDMaYiBJ0Yih27ogHswfzCzPsJjiIHkaIFcSjJM7EOD/e0MfObmWkNOV4 F9nyhgR1RA5b0Z5dGPgONIkjCAMIFAuRwhztNUBlMi4Spd8gkCrfXZ3SSmCUV2WseQSI bkD7MPOmk3QpzMYqARK5Q5zlVNecZh9860yaagnrVK3XMqNHDvVigH3lmxGTXmQpWrt+ yXdw== X-Gm-Message-State: ACrzQf3UMAmQkQ8zW7KXu+OYh4FWTAT8JocrhhYli0ArMkUAAzb1gHGi UARvU+SZth+edy3FpggN0RNWqbov8/6RpA== X-Received: by 2002:a17:90b:4ac8:b0:20d:56c4:a892 with SMTP id mh8-20020a17090b4ac800b0020d56c4a892mr15335938pjb.19.1665730646836; Thu, 13 Oct 2022 23:57:26 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id d67-20020a621d46000000b00550724f8ea0sm850581pfd.128.2022.10.13.23.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 23:57:26 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Masahisa Kojima Subject: [PATCH v3 1/6] eficonfig: refactor eficonfig_select_file_handler() Date: Fri, 14 Oct 2022 15:56:55 +0900 Message-Id: <20221014065705.5249-2-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221014065705.5249-1-masahisa.kojima@linaro.org> References: <20221014065705.5249-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 --- No change since v2 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);