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 C5EBFC4332F for ; Wed, 9 Nov 2022 14:50:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8D4C85010; Wed, 9 Nov 2022 15:50:14 +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="a08suCzL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BCC1C85031; Wed, 9 Nov 2022 15:50:13 +0100 (CET) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 EE10584FE8 for ; Wed, 9 Nov 2022 15:50:10 +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-wm1-x32e.google.com with SMTP id c3-20020a1c3503000000b003bd21e3dd7aso1420683wma.1 for ; Wed, 09 Nov 2022 06:50:10 -0800 (PST) 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=IZFfmooaW8yYQFiMc43ayfMDQ8dEUmfGQvHCEGIC2wo=; b=a08suCzLZ7/PDXEAdVEj78e4nYTW1Grpk7L9h3M+vRvXDK9hHn2GDdcflmfw5loYOU u5QBNGHN2zOBSokWdQkcehKExluVRLBAp5jJQNEp0i0fV35HhUJn+pa3679qCRZT6kSb ECslOTVsGlTaTRaQH5Kpze7XoMUVokA1cSs4ONdnxHlQ5vacNFovDfmn9WfllWMGSAfz BRWNV/de1loDi2XlXaN0GRGMMG8hXuN/Z2gKV12pDIG6OiexYkdliTet6v/5toHZfZnK Kp8lV4Y0uSNcb9SXqAZ7PKpxbyDd0a0p21TkYkKcs8QCkNZjXcxL2G6HMOVpOTTOYsLv 8FYA== 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=IZFfmooaW8yYQFiMc43ayfMDQ8dEUmfGQvHCEGIC2wo=; b=h3NyU3BRFfTW4z596j7dnlJXGa5aGg7ub/GPfZzYiAmRH3D6MpIm0Kkny891c50vjt jXRImwfabzN9tteoixVIR7FbLOOTvYwQn2G4JdJMc3VshyFoNccUTwb2XzkAPFV74h6O Cdyhsd1JlOgtstEk5nEznB0pMPEr8t1ABWKnWl280gvf1KtI99g6ApZKPYxahDX5mdDa EUeXKhSwZpHrC2lprTnhDwiWsBfNIOmniI+AwpxF5Rhw+muaMIgo8hFckfMSFJFi2byp Nvz1gsyerbA7LyMZdsYDXpdV+YjDQ7MvhcvW0CdbFuo78YSbzQYNio0Vp7DPAcIpHwF6 WaJg== X-Gm-Message-State: ACrzQf0InZE2Sw5C7RnjL5gt8vY6kbOc7ESYRxF5MpbghCdSjPvIvKol dyDqYN7MS6rB5iJObvbvqIuZ3A== X-Google-Smtp-Source: AMsMyM6QPtxMP7YmZZRvdkV6IqeBjkRa+TSIANc8IlSOIGqegR8T5gb+59cKH1zgGPa93XjpZ733EQ== X-Received: by 2002:a7b:c5d8:0:b0:3cf:9cd9:a889 with SMTP id n24-20020a7bc5d8000000b003cf9cd9a889mr17506080wmk.26.1668005410466; Wed, 09 Nov 2022 06:50:10 -0800 (PST) Received: from hera (ppp046103046165.access.hol.gr. [46.103.46.165]) by smtp.gmail.com with ESMTPSA id o4-20020a05600c510400b003c6d21a19a0sm2136956wms.29.2022.11.09.06.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 06:50:09 -0800 (PST) Date: Wed, 9 Nov 2022 16:50:06 +0200 From: Ilias Apalodimas To: Masahisa Kojima Cc: kojima.masahisa@socionext.com, u-boot@lists.denx.de, Heinrich Schuchardt , Simon Glass , Takahiro Akashi , Etienne Carriere Subject: Re: [PATCH v7 1/5] eficonfig: refactor file selection handling Message-ID: References: <20221109033728.5623-1-masahisa.kojima@linaro.org> <20221109033728.5623-2-masahisa.kojima@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221109033728.5623-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 On Wed, Nov 09, 2022 at 12:37:24PM +0900, Masahisa Kojima wrote: > eficonfig_select_file_handler() is commonly used to select the > file. eficonfig_display_select_file_option() adds an additional > menu to clear the selected file. > eficonfig_display_select_file_option() is not always necessary > for the file selection process, so it must be outside of > eficonfig_select_file_handler(). > > This commit also renames the following functions to avoid confusion. > eficonfig_select_file_handler() -> eficonfig_process_select_file() > eficonfig_select_file() -> eficonfig_show_file_selection() > eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() > > Finally, test_eficonfig.py need to be updated to get aligned with > the above modification. > > Signed-off-by: Masahisa Kojima > --- > Changes in v7: > - rename functio name to avoid confusion > - remove unused function > - update commit message > > newly created in v2 > > cmd/eficonfig.c | 37 ++++++------------- > include/efi_config.h | 2 +- > .../py/tests/test_eficonfig/test_eficonfig.py | 1 + > 3 files changed, 13 insertions(+), 27 deletions(-) > > diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c > index 2595dd9563..571e2b9ac0 100644 > --- a/cmd/eficonfig.c > +++ b/cmd/eficonfig.c > @@ -756,14 +756,14 @@ out: > } > > /** > - * eficonfig_select_file() - construct the file selection menu > + * eficonfig_show_file_selection() - construct the file selection menu > * > * @file_info: pointer to the file selection structure > * @root: pointer to the file handle > * Return: status code > */ > -static efi_status_t eficonfig_select_file(struct eficonfig_select_file_info *file_info, > - struct efi_file_handle *root) > +static efi_status_t eficonfig_show_file_selection(struct eficonfig_select_file_info *file_info, > + struct efi_file_handle *root) > { > u32 count = 0, i; > efi_uintn_t len; > @@ -938,17 +938,6 @@ static efi_status_t eficonfig_boot_edit_save(void *data) > return EFI_SUCCESS; > } > > -/** > - * eficonfig_process_select_file() - callback function for "Select File" entry > - * > - * @data: pointer to the data > - * Return: status code > - */ > -efi_status_t eficonfig_process_select_file(void *data) > -{ > - return EFI_SUCCESS; > -} > - > /** > * eficonfig_process_clear_file_selection() - callback function for "Clear" entry > * > @@ -973,19 +962,19 @@ static struct eficonfig_item select_file_menu_items[] = { > {"Quit", eficonfig_process_quit}, > }; > > - > /** > - * eficonfig_display_select_file_option() - display select file option > + * eficonfig_process_show_file_option() - display select file option > * > * @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_process_show_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) > @@ -1001,12 +990,12 @@ efi_status_t eficonfig_display_select_file_option(struct eficonfig_select_file_i > } > > /** > - * eficonfig_select_file_handler() - handle user file selection > + * eficonfig_process_select_file() - handle user file selection > * > * @data: pointer to the data > * Return: status code > */ > -efi_status_t eficonfig_select_file_handler(void *data) > +efi_status_t eficonfig_process_select_file(void *data) > { > size_t len; > efi_status_t ret; > @@ -1016,10 +1005,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; > @@ -1046,7 +1031,7 @@ efi_status_t eficonfig_select_file_handler(void *data) > if (ret != EFI_SUCCESS) > goto out; > > - ret = eficonfig_select_file(tmp, root); > + ret = eficonfig_show_file_selection(tmp, root); > if (ret == EFI_ABORTED) > continue; > if (ret != EFI_SUCCESS) > @@ -1284,7 +1269,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_process_show_file_option, file_info); > out: > free(devname); > free(file_name); > diff --git a/include/efi_config.h b/include/efi_config.h > index 098cac2115..cc6aa51393 100644 > --- a/include/efi_config.h > +++ b/include/efi_config.h > @@ -89,7 +89,7 @@ void eficonfig_print_msg(char *msg); > void eficonfig_destroy(struct efimenu *efi_menu); > efi_status_t eficonfig_process_quit(void *data); > efi_status_t eficonfig_process_common(struct efimenu *efi_menu, char *menu_header); > -efi_status_t eficonfig_select_file_handler(void *data); > +efi_status_t eficonfig_process_select_file(void *data); > efi_status_t eficonfig_get_unused_bootoption(u16 *buf, > efi_uintn_t buf_size, u32 *index); > efi_status_t eficonfig_append_bootorder(u16 index); > 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 > Reviewed-by: Ilias Apalodimas