public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Liming Gao" <liming.gao@intel.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Laszlo Ersek <lersek@redhat.com>,
	"Wang, Jian J" <jian.j.wang@intel.com>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH v3 6/7] MdeModulePkg/PeCoffImageEmulator: avoid redeclaration of typedef
Date: Mon, 3 Jun 2019 00:33:08 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E468D78@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20190531124958.8421-7-ard.biesheuvel@linaro.org>

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>Sent: Friday, May 31, 2019 8:50 PM
>To: devel@edk2.groups.io
>Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Laszlo Ersek
><lersek@redhat.com>; Gao, Liming <liming.gao@intel.com>; Wang, Jian J
><jian.j.wang@intel.com>; Leif Lindholm <leif.lindholm@linaro.org>; Kinney,
>Michael D <michael.d.kinney@intel.com>
>Subject: [PATCH v3 6/7] MdeModulePkg/PeCoffImageEmulator: avoid
>redeclaration of typedef
>
>The usual pattern of defining a protocol in EDK2 is
>
>  typedef struct _FOO_PROTOCOL FOO_PROTOCOL;
>
>  <definitions of protocol methods referring to FOO_PROTOCOL>
>
>  struct _FOO_PROTOCOL {
>    <method 1>
>    <method 2>
>    ...
>   };
>
>However, in the definition of EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL,
>we are deviating from this for no good reason, and instead, the
>struct definition is combined with a redefinition of the first
>typedef, and this is not permitted before C11.
>
>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>---
> MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h
>b/MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h
>index 29633e9a8ed4..9ea080eefb56 100644
>--- a/MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h
>+++ b/MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h
>@@ -91,7 +91,7 @@ EFI_STATUS
>
> #define EDKII_PECOFF_IMAGE_EMULATOR_VERSION         0x1
>
>-typedef struct _EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL {
>+struct _EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL {
>   EDKII_PECOFF_IMAGE_EMULATOR_IS_IMAGE_SUPPORTED
>IsImageSupported;
>   EDKII_PECOFF_IMAGE_EMULATOR_REGISTER_IMAGE        RegisterImage;
>   EDKII_PECOFF_IMAGE_EMULATOR_UNREGISTER_IMAGE
>UnregisterImage;
>@@ -100,7 +100,7 @@ typedef struct
>_EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL {
>   UINT32                                            Version;
>   // The machine type implemented by the emulator
>   UINT16                                            MachineType;
>-} EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL;
>+};
>
> extern EFI_GUID gEdkiiPeCoffImageEmulatorProtocolGuid;
>
>--
>2.20.1


  reply	other threads:[~2019-06-03  0:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 12:49 [PATCH v3 0/7] update ArmSoftFloatLib to latest upstream version Ard Biesheuvel
2019-05-31 12:49 ` [PATCH v3 1/7] ArmPkg: import Berkeley Softfloat library as git submodule Ard Biesheuvel
2019-05-31 12:49 ` [PATCH v3 2/7] ArmPkg/ArmSoftFloatLib: switch to new version of softfloat library Ard Biesheuvel
2019-05-31 13:20   ` Leif Lindholm
2019-05-31 13:22     ` Ard Biesheuvel
2019-05-31 13:26       ` Leif Lindholm
2019-05-31 13:39         ` Ard Biesheuvel
2019-05-31 13:49           ` Leif Lindholm
2019-05-31 14:32             ` Ard Biesheuvel
2019-05-31 12:49 ` [PATCH v3 3/7] ArmPkg/ArmSoftFloatLib: remove source files that are no longer used Ard Biesheuvel
2019-05-31 12:49 ` [PATCH v3 4/7] BaseTools/tools_def CLANG3x ARM AARCH64: force use of C99 standard Ard Biesheuvel
2019-05-31 12:49 ` [PATCH v3 5/7] ArmPkg/ArmLib ARM: set .fpu to let Clang 7 assemble ArmV7Support.S Ard Biesheuvel
2019-05-31 12:49 ` [PATCH v3 6/7] MdeModulePkg/PeCoffImageEmulator: avoid redeclaration of typedef Ard Biesheuvel
2019-06-03  0:33   ` Liming Gao [this message]
2019-05-31 12:49 ` [PATCH v3 7/7] MdePkg: avoid redeclaration of typedefs Ard Biesheuvel
2019-06-03  0:33   ` Liming Gao
2019-05-31 13:09 ` [PATCH v3 0/7] update ArmSoftFloatLib to latest upstream version Leif Lindholm
2019-05-31 16:00   ` [edk2-devel] " Ard Biesheuvel
2019-05-31 16:21     ` Michael D Kinney
2019-05-31 19:28       ` Leif Lindholm
2019-05-31 19:31         ` Michael D Kinney
2019-06-03  0:59         ` Liming Gao
2019-06-03  6:04           ` Ard Biesheuvel
2019-06-03  0:32     ` Liming Gao

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=4A89E2EF3DFEDB4C8BFDE51014F606A14E468D78@SHSMSX104.ccr.corp.intel.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