public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, guomin.jiang@intel.com
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: Re: [edk2-devel] [PATCH v2 6/6] MdePkg/Security2: Mark the File parameter as OPTIONAL.
Date: Mon, 20 Apr 2020 13:27:55 +0200	[thread overview]
Message-ID: <666e5fce-24a0-7f00-7ad2-15e66df99a77@redhat.com> (raw)
In-Reply-To: <20200416073354.2232-7-guomin.jiang@intel.com>

On 04/16/20 09:33, Guomin Jiang wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2652
> 
> According to the description, the File is OPTIONAL and can be NULL.
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> ---
>  MdePkg/Include/Protocol/Security2.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/Protocol/Security2.h b/MdePkg/Include/Protocol/Security2.h
> index 2d85b4ba9f..6a63009956 100644
> --- a/MdePkg/Include/Protocol/Security2.h
> +++ b/MdePkg/Include/Protocol/Security2.h
> @@ -80,7 +80,7 @@ typedef struct _EFI_SECURITY2_ARCH_PROTOCOL    EFI_SECURITY2_ARCH_PROTOCOL;
>  **/
>  typedef EFI_STATUS (EFIAPI *EFI_SECURITY2_FILE_AUTHENTICATION) (
>    IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This,
> -  IN CONST EFI_DEVICE_PATH_PROTOCOL    *DevicePath,
> +  IN CONST EFI_DEVICE_PATH_PROTOCOL    *DevicePath, OPTIONAL
>    IN VOID                              *FileBuffer,
>    IN UINTN                             FileSize,
>    IN BOOLEAN                           BootPolicy
> 

(1) I think writing

  DevicePath OPTIONAL,

is a bit more idiomatic than

  DevicePath, OPTIONAL

However, the UEFI spec contains examples for both styles of comma
placement in parameter lists; and so I think this change is valid,
albeit somewhat unusual. So that's good.

(2) Unfortunately, I don't think the patch is complete. If you look at
the entire function declaration in the header file, the documentation
*inconsistently* calls the parameter both "File" and "DevicePath". If
you search the leading comment, there are both "File" and "DevicePath"
references.

Therefore the reference in the commit message, "According to the
description, the File is OPTIONAL", is actually a dangling reference,
because *that* particular part of the documentation calls the parameter
"File".

Please rework this patch so that the documentation and the parameter
list fully agree on the parameter's name.

According to the platform init spec (1.7),
EFI_SECURITY2_ARCH_PROTOCOL.FileAuthentication(), the name of the
parameter is "DevicePath". So please replace all relevant "File"
references in the leading comment with "DevicePath".

(3) Also, I think it would be prudent to file a ticket in Mantis, to
mark "DevicePath" as OPTIONAL in the spec too.

Thanks
Laszlo


  reply	other threads:[~2020-04-20 11:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16  7:33 [PATCH v2 0/6] Mark the File parameter as OPTIONAL Guomin Jiang
2020-04-16  7:33 ` [PATCH v2 1/6] SecurityPkg/TPM: measure UEFI images without associated device paths again Guomin Jiang
2020-04-16  7:33 ` [PATCH v2 2/6] SecurityPkg/DxeImageAuth: Mark the File parameter as option Guomin Jiang
2020-04-16  7:33 ` [PATCH v2 3/6] SecurityPkg/DxeImageVerificationLib: Mark the File parameter as OPTIONAL Guomin Jiang
2020-04-16  7:33 ` [PATCH v2 4/6] MdeModulePkg/SecurityManagementLib: " Guomin Jiang
2020-04-20 11:31   ` [edk2-devel] " Laszlo Ersek
2020-04-16  7:33 ` [PATCH v2 5/6] MdeModulePkg/SecurityStubDxe: " Guomin Jiang
2020-04-16  7:33 ` [PATCH v2 6/6] MdePkg/Security2: " Guomin Jiang
2020-04-20 11:27   ` Laszlo Ersek [this message]
2020-04-21 14:21   ` [edk2-devel] " Liming Gao
2020-04-20 11:39 ` [edk2-devel] [PATCH v2 0/6] " Laszlo Ersek
2020-04-21  2:15   ` Guomin Jiang
2020-04-21  8:52 ` Wang, Jian J

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=666e5fce-24a0-7f00-7ad2-15e66df99a77@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox