Re: [edk2-devel] [edk2-platforms Patch V3 10/12] Vlv2TbltDevicePkg: Fix XCODE5 build errors

2019-07-22 Thread Sun, Zailiang
Reviewed-by: Zailiang Sun 

> -Original Message-
> From: Kinney, Michael D
> Sent: Tuesday, July 23, 2019 6:59 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ;
> Gary Lin 
> Subject: [edk2-platforms Patch V3 10/12] Vlv2TbltDevicePkg: Fix XCODE5
> build errors
> 
> * Remove extra parenthesis in if statements
> * Remove local variable structure initialization
>   that adds use of memcpy() on XCODE X64 builds.
>   Move per-initialize structure to a module global.
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Cc: Gary Lin 
> Signed-off-by: Michael D Kinney 
> ---
>  .../Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c| 12 ++--
>  .../Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c  |  2 +-
>  .../Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c  |  2 +-
>  .../VlvPlatformInitDxe/IgdOpRegion.c |  2 +-
>  4 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/Platform/Intel/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> b/Platform/Intel/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> index 479ffa61a0..3e0b978120 100644
> --- a/Platform/Intel/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> +++ b/Platform/Intel/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> @@ -63,6 +63,15 @@ SYSTEM_CONFIGURATION  mSystemConfig;
>  UINT8 mSmbusRsvdAddresses[] = PLATFORM_SMBUS_RSVD_ADDRESSES;
>  UINT8 mNumberSmbusAddress = sizeof( mSmbusRsvdAddresses ) /
> sizeof( mSmbusRsvdAddresses[0] );
> 
> +EFI_ACPI_OSFR_OCUR_OBJECT  mOcurObjectTemplate = {
> +  {0xB46F133D, 0x235F, 0x4634, 0x9F, 0x03, 0xB1, 0xC0, 0x1C, 0x54,
> +0x78, 0x5B},
> +  0,
> +  0,
> +  0,
> +  0,
> +  0
> +};
> +
>  /**
>Locate the first instance of a protocol.  If the protocol requested is an
>FV protocol, then it will return the first FV that contains the ACPI table 
> @@ -
> 203,7 +212,6 @@ PlatformUpdateTables (
>EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE   *Facp;
>EFI_ACPI_OSFR_TABLE *OsfrTable;
>EFI_ACPI_OSFR_OCUR_OBJECT   *pOcurObject;
> -  EFI_ACPI_OSFR_OCUR_OBJECT   OcurObject =
> {{0xB46F133D, 0x235F, 0x4634, 0x9F, 0x03, 0xB1, 0xC0, 0x1C, 0x54, 0x78, 0x5B},
> 0, 0, 0, 0, 0};
>CHAR16  
> *OcurMfgStringBuffer = NULL;
>CHAR16  
> *OcurModelStringBuffer = NULL;
>UINT8   
> *OcurRefDataBlockBuffer = NULL;
> @@ -554,7 +562,7 @@ PlatformUpdateTables (
>  (UINT32) (sizeof (EFI_ACPI_OSFR_TABLE_FIXED_PORTION) + sizeof
> (UINT32));
>pOcurObject = (EFI_ACPI_OSFR_OCUR_OBJECT *)((UINTN) OsfrTable +
> sizeof (EFI_ACPI_OSFR_TABLE_FIXED_PORTION) + \
>  sizeof (UINT32));
> -  CopyMem (pOcurObject, , sizeof
> (EFI_ACPI_OSFR_OCUR_OBJECT));
> +  CopyMem (pOcurObject, , sizeof
> + (EFI_ACPI_OSFR_OCUR_OBJECT));
>pOcurObject->ManufacturerNameStringOffset = (UINT32)((UINTN)
> pOcurObject - (UINTN) OsfrTable + \
>  sizeof (EFI_ACPI_OSFR_OCUR_OBJECT));
>pOcurObject->ModelNameStringOffset = (UINT32)((UINTN)
> pOcurObject - (UINTN) OsfrTable + \ diff --git
> a/Platform/Intel/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
> b/Platform/Intel/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
> index b1c01afc16..69ced08a58 100644
> --- a/Platform/Intel/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
> +++ b/Platform/Intel/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
> @@ -250,7 +250,7 @@ GetPciRom (
>  //
>  // Do not run RAID or AHCI Option ROM if IDE
>  //
> -if ( (DeviceClass == ((PCI_CLASS_MASS_STORAGE << 8 ) |
> PCI_CLASS_MASS_STORAGE_IDE)) ) {
> +if (DeviceClass == ((PCI_CLASS_MASS_STORAGE << 8 ) |
> + PCI_CLASS_MASS_STORAGE_IDE)) {
>return EFI_NOT_FOUND;
>  }
> 
> diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
> b/Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
> index 71d6cb7c15..0b5d7f76a1 100644
> --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
> +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
> @@ -514,7 +514,7 @@ IchRcrbInit (
>//
>// Initial RCBA according to the PeiRCBA table
>//
> -  if ((BootMode == BOOT_ON_S3_RESUME)) {
> +  if (BootMode == BOOT_ON_S3_RESUME) {
>  //
>  // We are resuming from S3
>  // Enable HPET if enabled in Setup
> diff --git
> a/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> b/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> index dad27f130d..fcd9e566ae 100644
> --- a/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> +++ b/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> @@ -573,7 +573,7 @@ GetVBiosVbtCallback (
>  return EFI_SUCCESS;
>}
>  }
> -if ((VBiosPtr == NULL) ) {
> +

[edk2-devel] [edk2-platforms Patch V3 10/12] Vlv2TbltDevicePkg: Fix XCODE5 build errors

2019-07-22 Thread Michael D Kinney
* Remove extra parenthesis in if statements
* Remove local variable structure initialization
  that adds use of memcpy() on XCODE X64 builds.
  Move per-initialize structure to a module global.

Cc: Zailiang Sun 
Cc: Yi Qian 
Cc: Gary Lin 
Signed-off-by: Michael D Kinney 
---
 .../Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c| 12 ++--
 .../Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c  |  2 +-
 .../Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c  |  2 +-
 .../VlvPlatformInitDxe/IgdOpRegion.c |  2 +-
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/Platform/Intel/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c 
b/Platform/Intel/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index 479ffa61a0..3e0b978120 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Platform/Intel/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -63,6 +63,15 @@ SYSTEM_CONFIGURATION  mSystemConfig;
 UINT8 mSmbusRsvdAddresses[] = PLATFORM_SMBUS_RSVD_ADDRESSES;
 UINT8 mNumberSmbusAddress = sizeof( mSmbusRsvdAddresses ) / sizeof( 
mSmbusRsvdAddresses[0] );
 
+EFI_ACPI_OSFR_OCUR_OBJECT  mOcurObjectTemplate = {
+  {0xB46F133D, 0x235F, 0x4634, 0x9F, 0x03, 0xB1, 0xC0, 0x1C, 0x54, 0x78, 0x5B},
+  0,
+  0,
+  0,
+  0,
+  0
+};
+
 /**
   Locate the first instance of a protocol.  If the protocol requested is an
   FV protocol, then it will return the first FV that contains the ACPI table
@@ -203,7 +212,6 @@ PlatformUpdateTables (
   EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE   *Facp;
   EFI_ACPI_OSFR_TABLE *OsfrTable;
   EFI_ACPI_OSFR_OCUR_OBJECT   *pOcurObject;
-  EFI_ACPI_OSFR_OCUR_OBJECT   OcurObject = 
{{0xB46F133D, 0x235F, 0x4634, 0x9F, 0x03, 0xB1, 0xC0, 0x1C, 0x54, 0x78, 0x5B}, 
0, 0, 0, 0, 0};
   CHAR16  
*OcurMfgStringBuffer = NULL;
   CHAR16  
*OcurModelStringBuffer = NULL;
   UINT8   
*OcurRefDataBlockBuffer = NULL;
@@ -554,7 +562,7 @@ PlatformUpdateTables (
 (UINT32) (sizeof (EFI_ACPI_OSFR_TABLE_FIXED_PORTION) + sizeof 
(UINT32));
   pOcurObject = (EFI_ACPI_OSFR_OCUR_OBJECT *)((UINTN) OsfrTable + 
sizeof (EFI_ACPI_OSFR_TABLE_FIXED_PORTION) + \
 sizeof (UINT32));
-  CopyMem (pOcurObject, , sizeof 
(EFI_ACPI_OSFR_OCUR_OBJECT));
+  CopyMem (pOcurObject, , sizeof 
(EFI_ACPI_OSFR_OCUR_OBJECT));
   pOcurObject->ManufacturerNameStringOffset = (UINT32)((UINTN) 
pOcurObject - (UINTN) OsfrTable + \
 sizeof (EFI_ACPI_OSFR_OCUR_OBJECT));
   pOcurObject->ModelNameStringOffset = (UINT32)((UINTN) pOcurObject - 
(UINTN) OsfrTable + \
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c 
b/Platform/Intel/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
index b1c01afc16..69ced08a58 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
+++ b/Platform/Intel/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
@@ -250,7 +250,7 @@ GetPciRom (
 //
 // Do not run RAID or AHCI Option ROM if IDE
 //
-if ( (DeviceClass == ((PCI_CLASS_MASS_STORAGE << 8 ) | 
PCI_CLASS_MASS_STORAGE_IDE)) ) {
+if (DeviceClass == ((PCI_CLASS_MASS_STORAGE << 8 ) | 
PCI_CLASS_MASS_STORAGE_IDE)) {
   return EFI_NOT_FOUND;
 }
 
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c 
b/Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
index 71d6cb7c15..0b5d7f76a1 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
+++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
@@ -514,7 +514,7 @@ IchRcrbInit (
   //
   // Initial RCBA according to the PeiRCBA table
   //
-  if ((BootMode == BOOT_ON_S3_RESUME)) {
+  if (BootMode == BOOT_ON_S3_RESUME) {
 //
 // We are resuming from S3
 // Enable HPET if enabled in Setup
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c 
b/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
index dad27f130d..fcd9e566ae 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
+++ b/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
@@ -573,7 +573,7 @@ GetVBiosVbtCallback (
 return EFI_SUCCESS;
   }
 }
-if ((VBiosPtr == NULL) ) {
+if (VBiosPtr == NULL) {
   //
   // Intel video BIOS not found.
   //
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#44175): https://edk2.groups.io/g/devel/message/44175
Mute This Topic: https://groups.io/mt/32564743/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-