From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: liming.gao@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Sun, 02 Jun 2019 17:33:11 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jun 2019 17:33:10 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 02 Jun 2019 17:33:10 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 2 Jun 2019 17:33:10 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 2 Jun 2019 17:33:10 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.137]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.98]) with mapi id 14.03.0415.000; Mon, 3 Jun 2019 08:33:08 +0800 From: "Liming Gao" To: Ard Biesheuvel , "devel@edk2.groups.io" CC: Laszlo Ersek , "Wang, Jian J" , Leif Lindholm , "Kinney, Michael D" Subject: Re: [PATCH v3 6/7] MdeModulePkg/PeCoffImageEmulator: avoid redeclaration of typedef Thread-Topic: [PATCH v3 6/7] MdeModulePkg/PeCoffImageEmulator: avoid redeclaration of typedef Thread-Index: AQHVF69tWDbYfNYRyEewyZzMKM5ihKaJGHTw Date: Mon, 3 Jun 2019 00:33:08 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E468D78@SHSMSX104.ccr.corp.intel.com> References: <20190531124958.8421-1-ard.biesheuvel@linaro.org> <20190531124958.8421-7-ard.biesheuvel@linaro.org> In-Reply-To: <20190531124958.8421-7-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----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 ; Laszlo Ersek >; Gao, Liming ; Wang, Jian J >; Leif Lindholm ; Kinney, >Michael D >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; > > > > struct _FOO_PROTOCOL { > > > ... > }; > >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 >--- > 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