From nobody Sat May 4 07:21:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523957444116905.634944912746; Tue, 17 Apr 2018 02:30:44 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DE5ED21F2E195; Tue, 17 Apr 2018 02:30:42 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A1CDA21F2E18D for ; Tue, 17 Apr 2018 02:30:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0E578424E; Tue, 17 Apr 2018 09:30:40 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-161.rdu2.redhat.com [10.10.120.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15C82111DCEB; Tue, 17 Apr 2018 09:30:39 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Tue, 17 Apr 2018 11:30:38 +0200 Message-Id: <20180417093038.22093-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 17 Apr 2018 09:30:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 17 Apr 2018 09:30:41 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH] MdeModulePkg/UefiBootManagerLib: fix AddLoadOptionVariable docs/prototype X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Eric Dong , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Clean up the leading comment and the prototype of EfiBootManagerAddLoadOptionVariable(): - the function may modify Option on output, annotate the parameter with OUT and update the documentation; - "@retval EFI_STATUS" and "@retval Others" are not idiomatic documentation, use @return instead; - sync comment and prototype between lib instance and lib class header. Cc: Eric Dong Cc: Ruiyu Ni Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Star Zeng --- Notes: Repo: https://github.com/lersek/edk2.git Branch: add_load_opt_inout MdeModulePkg/Include/Library/UefiBootManagerLib.h | 26 +++++++++++++++---= ---- .../Library/UefiBootManagerLib/BmLoadOption.c | 12 ++++++---- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h b/MdeModuleP= kg/Include/Library/UefiBootManagerLib.h index 97ac1f233ce9..1d862a4b2684 100644 --- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h +++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h @@ -176,20 +176,30 @@ EfiBootManagerLoadOptionToVariable ( ); =20 /** - This function will update the Boot####/Driver####/SysPrep#### and the=20 - BootOrder/DriverOrder/SysPrepOrder to add a new load option. + This function will register the new Boot####, Driver#### or SysPrep#### = option. + After the *#### is updated, the *Order will also be updated. =20 - @param Option Pointer to load option to add. - @param Position Position of the new load option to put in the Boot= Order/DriverOrder/SysPrepOrder. + @param Option Pointer to load option to add. If on input + Option->OptionNumber is LoadOptionNumberUnassi= gned, + then on output Option->OptionNumber is updated= to + the number of the new Boot####, + Driver#### or SysPrep#### option. + @param Position Position of the new load option to put in the = ****Order variable. + + @retval EFI_SUCCESS The *#### have been successfully registere= d. + @retval EFI_INVALID_PARAMETER The option number exceeds 0xFFFF. + @retval EFI_ALREADY_STARTED The option number of Option is being used = already. + Note: this API only adds new load option, = no replacement support. + @retval EFI_OUT_OF_RESOURCES There is no free option number that can be= used when the + option number specified in the Option is L= oadOptionNumberUnassigned. + @return Status codes of gRT->SetVariable (). =20 - @retval EFI_SUCCESS The load option has been successfully added. - @retval Others Error status returned by RT->SetVariable. **/ EFI_STATUS EFIAPI EfiBootManagerAddLoadOptionVariable ( - IN EFI_BOOT_MANAGER_LOAD_OPTION *Option, - IN UINTN Position + IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *Option, + IN UINTN Position ); =20 /** diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/MdeMo= dulePkg/Library/UefiBootManagerLib/BmLoadOption.c index 32918caf324c..f88f8e02451c 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c @@ -329,7 +329,11 @@ BmAddOptionNumberToOrderVariable ( This function will register the new Boot####, Driver#### or SysPrep#### = option. After the *#### is updated, the *Order will also be updated. =20 - @param Option Pointer to load option to add. + @param Option Pointer to load option to add. If on input + Option->OptionNumber is LoadOptionNumberUnassi= gned, + then on output Option->OptionNumber is updated= to + the number of the new Boot####, + Driver#### or SysPrep#### option. @param Position Position of the new load option to put in the = ****Order variable. =20 @retval EFI_SUCCESS The *#### have been successfully registere= d. @@ -338,14 +342,14 @@ BmAddOptionNumberToOrderVariable ( Note: this API only adds new load option, = no replacement support. @retval EFI_OUT_OF_RESOURCES There is no free option number that can be= used when the option number specified in the Option is L= oadOptionNumberUnassigned. - @retval EFI_STATUS Return the status of gRT->SetVariable (). + @return Status codes of gRT->SetVariable (). =20 **/ EFI_STATUS EFIAPI EfiBootManagerAddLoadOptionVariable ( - IN EFI_BOOT_MANAGER_LOAD_OPTION *Option, - IN UINTN Position + IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *Option, + IN UINTN Position ) { EFI_STATUS Status; --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel