From mboxrd@z Thu Jan 1 00:00:00 1970 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 3C044C433FE for ; Fri, 4 Nov 2022 15:12:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3F3D85202; Fri, 4 Nov 2022 16:12:36 +0100 (CET) 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="DTPnjsyz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 321E385235; Fri, 4 Nov 2022 16:12:35 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 9FB5F85113 for ; Fri, 4 Nov 2022 16:12:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x536.google.com with SMTP id y69so8042778ede.5 for ; Fri, 04 Nov 2022 08:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OWTLqekNXWOTPFHKa33nltleXW/yGBp6EUZMKBK02oo=; b=DTPnjsyz9u2IgBlbAmamdhTSWY7tcCeGEZCwS+NX3pQ6nSx8x5YuA7HeJF0J64xAxt EEf/FYDQY654mgbPr7vVyEa+otFG0UNDjZwIaCsjFK1098/t/6W5RdsjddnvTE5+7A1u sWJkbYgwcMzyijAoYdk7k8BwX1ph6w3+s/JGHjW2Levoa9mUF745DC9I1h+WElaQcgpy jelPAPxQHh6JI9llxoik5chd2sPrUElN/B8lc9Uzt5qxDbC9D3KGSboDLMCsDpybTB+x vlyf2wThPZ6rQbGl8nQ71k094cbUy1QWiTpYJLD58zfqaO7Dpu5dTwyjBZ1PB0kqn8Qz e0fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OWTLqekNXWOTPFHKa33nltleXW/yGBp6EUZMKBK02oo=; b=luHiD9yCZI/C54Iaq4cjqf1bg1IECs9AzIPUjlSjGmuiVwaR4sp2xjzPCU8yT0GcKQ 9AZ+UMVVr5xGzUo6BmqB69uuxiyozfvXZKC+ozeh8bJ9PD/DOiIK8DCctTEjLiII3Ak7 39xsmsCssrfMHzrfrTlkecIvQEIoCZtMnt/I3K+mPYP9vkrVISc21IDicDGFY/4j9Dkw tbhdnZUTxTq2ZTk66UGJUJ8w9YBKhPm4cGtIH6c/ZZ7bTXoHxnGTX43G0UoC5uxT5Iqi YSEqebwNtEOxT+KyaniAEKjTDQcm+q3HC2dyxI7HPGTlv6oR/VXU1eqskiggl9DHoH0l M9hQ== X-Gm-Message-State: ACrzQf0094u26X2L/oqXgeNDEpUJWLbL8cmjxoFckaFPjwqUa2bofDOg FWxZ4Bl/dq5Axnx8CqduBZkb0RjSJbyPld2K X-Google-Smtp-Source: AMsMyM7FDkpm+hU+ojGPRMDW3PSYxNUEGV93g/6TXizOJElT2mF1ok7TwiJMg0mt759eFJSm+3/fTw== X-Received: by 2002:a05:6402:1348:b0:461:c056:bf65 with SMTP id y8-20020a056402134800b00461c056bf65mr36853701edw.414.1667574752167; Fri, 04 Nov 2022 08:12:32 -0700 (PDT) Received: from hera (ppp046103046165.access.hol.gr. [46.103.46.165]) by smtp.gmail.com with ESMTPSA id 20-20020a170906329400b0077e6be40e4asm1937841ejw.175.2022.11.04.08.12.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 08:12:31 -0700 (PDT) Date: Fri, 4 Nov 2022 17:12:29 +0200 From: Ilias Apalodimas To: Masahisa Kojima Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Simon Glass , Takahiro Akashi , Etienne Carriere Subject: Re: [PATCH v6 1/5] eficonfig: refactor eficonfig_select_file_handler() Message-ID: References: <20221026104345.28714-1-masahisa.kojima@linaro.org> <20221026104345.28714-2-masahisa.kojima@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221026104345.28714-2-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 Hi Kojima-san I think there's some information missing from the commit message. On Wed, Oct 26, 2022 at 07:43:41PM +0900, Masahisa Kojima wrote: > 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() adds an additional menu to clear the selected file' sounds better? > eficonfig_display_select_file_option() is not necessary for the > file selection process, so it should be outside of > eficonfig_select_file_handler(). In a followup patch I think we should rename eficonfig_select_file(). It's a bit confusing to have both eficonfig_select_file_handler() and eficonfig_select_file() and iirc the latter creates the menu for the file selection. > > Signed-off-by: Masahisa Kojima > --- > No change since v2 > > newly created in v2 > > cmd/eficonfig.c | 13 +++++-------- > test/py/tests/test_eficonfig/test_eficonfig.py | 1 + > 2 files changed, 6 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}, eficonfig_process_select_file() is not used anywhere anymore now. We need to get rid of the function declaration > + {"Select File", eficonfig_select_file_handler}, This is a different change right? It effectively allows you to choose between files. Can we explain this change as well on the commit message? > {"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); > diff --git a/test/py/tests/test_eficonfig/test_eficonfig.py b/test/py/tests/test_eficonfig/test_eficonfig.py > index 99606d9c4b..102bfd7541 100644 > --- a/test/py/tests/test_eficonfig/test_eficonfig.py > +++ b/test/py/tests/test_eficonfig/test_eficonfig.py > @@ -349,6 +349,7 @@ def test_efi_eficonfig(u_boot_console, efi_eficonfig_data): > press_up_down_enter_and_wait(0, 1, True, 'Quit') > press_up_down_enter_and_wait(0, 0, True, 'No block device found!') > press_escape_key(False) > + press_escape_key(False) > check_current_is_maintenance_menu() > # Return to U-Boot console > press_escape_key(True) > -- > 2.17.1 > Thanks /Ilias