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.151, mailfrom: liming.gao@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Sun, 02 Jun 2019 17:33:06 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jun 2019 17:33:05 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 02 Jun 2019 17:33:05 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 2 Jun 2019 17:33:03 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 2 Jun 2019 17:33:03 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.137]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.247]) with mapi id 14.03.0415.000; Mon, 3 Jun 2019 08:33:01 +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 7/7] MdePkg: avoid redeclaration of typedefs Thread-Topic: [PATCH v3 7/7] MdePkg: avoid redeclaration of typedefs Thread-Index: AQHVF69v6MbEgz6rEEW7cKNQCFi56aaJGGhA Date: Mon, 3 Jun 2019 00:33:00 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E468D71@SHSMSX104.ccr.corp.intel.com> References: <20190531124958.8421-1-ard.biesheuvel@linaro.org> <20190531124958.8421-8-ard.biesheuvel@linaro.org> In-Reply-To: <20190531124958.8421-8-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 7/7] MdePkg: avoid redeclaration of typedefs > >The usual pattern of defining a protocol in EDK2 is > > typedef struct _FOO_PROTOCOL FOO_PROTOCOL; > > > > struct _FOO_PROTOCOL { > > > ... > }; > >However, in the definition of EFI_HII_POPUP_PROTOCOL and >EFI_RESET_NOTIFICATION_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 >--- > MdePkg/Include/Protocol/HiiPopup.h | 4 ++-- > MdePkg/Include/Protocol/ResetNotification.h | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/MdePkg/Include/Protocol/HiiPopup.h >b/MdePkg/Include/Protocol/HiiPopup.h >index e8161c3701ad..d7be784723b8 100644 >--- a/MdePkg/Include/Protocol/HiiPopup.h >+++ b/MdePkg/Include/Protocol/HiiPopup.h >@@ -67,10 +67,10 @@ EFI_STATUS > OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL > ); > >-typedef struct _EFI_HII_POPUP_PROTOCOL { >+struct _EFI_HII_POPUP_PROTOCOL { > UINT64 Revision; > EFI_HII_CREATE_POPUP CreatePopup; >-} EFI_HII_POPUP_PROTOCOL; >+}; > > extern EFI_GUID gEfiHiiPopupProtocolGuid; > >diff --git a/MdePkg/Include/Protocol/ResetNotification.h >b/MdePkg/Include/Protocol/ResetNotification.h >index 1142424e4610..b9aa321f639a 100644 >--- a/MdePkg/Include/Protocol/ResetNotification.h >+++ b/MdePkg/Include/Protocol/ResetNotification.h >@@ -68,10 +68,10 @@ EFI_STATUS > IN EFI_RESET_SYSTEM ResetFunction > ); > >-typedef struct _EFI_RESET_NOTIFICATION_PROTOCOL { >+struct _EFI_RESET_NOTIFICATION_PROTOCOL { > EFI_REGISTER_RESET_NOTIFY RegisterResetNotify; > EFI_UNREGISTER_RESET_NOTIFY UnregisterResetNotify; >-} EFI_RESET_NOTIFICATION_PROTOCOL; >+}; > > > extern EFI_GUID gEfiResetNotificationProtocolGuid; >-- >2.20.1