[edk2] OvmfPkg/Csm/CsmSupportLib: fix "missing braces around initializer"

Message ID 1406075026-24285-1-git-send-email-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek July 23, 2014, 12:23 a.m.
Recent BaseTools changes trigger this gcc warning.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Laszlo Ersek July 29, 2014, 11:53 a.m. | #1
On 07/23/14 02:23, Laszlo Ersek wrote:
> Recent BaseTools changes trigger this gcc warning.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c b/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
> index af8896a..867b128 100644
> --- a/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
> +++ b/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
> @@ -30,10 +30,10 @@ EFI_SETUP_BBS_MAP mSetupBbsMap[] = {
>  // Global variables for System ROMs
>  //
>  #define SYSTEM_ROM_FILE_GUID \
> -{ 0x1547B4F3, 0x3E8A, 0x4FEF, 0x81, 0xC8, 0x32, 0x8E, 0xD6, 0x47, 0xAB, 0x1A }
> +{ 0x1547B4F3, 0x3E8A, 0x4FEF, { 0x81, 0xC8, 0x32, 0x8E, 0xD6, 0x47, 0xAB, 0x1A } }
>  
>  #define NULL_ROM_FILE_GUID \
> -{ 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
> +{ 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
>  
>  SYSTEM_ROM_TABLE mSystemRomTable[] = {
>    { SYSTEM_ROM_FILE_GUID,  1 },
> @@ -82,12 +82,12 @@ EFI_LEGACY_PIRQ_TABLE PirqTableHead = {
>      //          -- Pin 1 -- -- Pin 2 -- -- Pin 3 -- -- Pin 4 --
>      // Bus  Dev  Reg   Map   Reg   Map   Reg   Map   Reg   Map
>  
> -    0x00,0x08,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x00,0x00,
> -    0x00,0x10,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x01,0x00,
> -    0x00,0x18,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x61,0xDEB8,0x02,0x00,
> -    0x00,0x20,0x63,0xDEB8,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x03,0x00,
> -    0x00,0x28,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x04,0x00,
> -    0x00,0x30,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x05,0x00,
> +    {0x00,0x08,{{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8}},0x00,0x00},
> +    {0x00,0x10,{{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8}},0x01,0x00},
> +    {0x00,0x18,{{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8},{0x61,0xDEB8}},0x02,0x00},
> +    {0x00,0x20,{{0x63,0xDEB8},{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8}},0x03,0x00},
> +    {0x00,0x28,{{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8}},0x04,0x00},
> +    {0x00,0x30,{{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8}},0x05,0x00},
>    }
>  };
>  
> 

Ping -- this update should be almost trivial to verify.

(The issue only presents itself with the non-default -D CSM_ENABLE build
flag, which is why people have not been complaining; but we should
certainly adapt these initializers eventually.)

Thanks
Laszlo

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
Jordan Justen July 29, 2014, 4:23 p.m. | #2
On Tue, Jul 29, 2014 at 4:53 AM, Laszlo Ersek <lersek@redhat.com> wrote:
> On 07/23/14 02:23, Laszlo Ersek wrote:
>> Recent BaseTools changes trigger this gcc warning.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c b/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
>> index af8896a..867b128 100644
>> --- a/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
>> +++ b/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
>> @@ -30,10 +30,10 @@ EFI_SETUP_BBS_MAP mSetupBbsMap[] = {
>>  // Global variables for System ROMs
>>  //
>>  #define SYSTEM_ROM_FILE_GUID \
>> -{ 0x1547B4F3, 0x3E8A, 0x4FEF, 0x81, 0xC8, 0x32, 0x8E, 0xD6, 0x47, 0xAB, 0x1A }
>> +{ 0x1547B4F3, 0x3E8A, 0x4FEF, { 0x81, 0xC8, 0x32, 0x8E, 0xD6, 0x47, 0xAB, 0x1A } }
>>
>>  #define NULL_ROM_FILE_GUID \
>> -{ 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
>> +{ 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
>>
>>  SYSTEM_ROM_TABLE mSystemRomTable[] = {
>>    { SYSTEM_ROM_FILE_GUID,  1 },
>> @@ -82,12 +82,12 @@ EFI_LEGACY_PIRQ_TABLE PirqTableHead = {
>>      //          -- Pin 1 -- -- Pin 2 -- -- Pin 3 -- -- Pin 4 --
>>      // Bus  Dev  Reg   Map   Reg   Map   Reg   Map   Reg   Map
>>
>> -    0x00,0x08,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x00,0x00,
>> -    0x00,0x10,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x01,0x00,
>> -    0x00,0x18,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x61,0xDEB8,0x02,0x00,
>> -    0x00,0x20,0x63,0xDEB8,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x03,0x00,
>> -    0x00,0x28,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x04,0x00,
>> -    0x00,0x30,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x05,0x00,
>> +    {0x00,0x08,{{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8}},0x00,0x00},
>> +    {0x00,0x10,{{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8}},0x01,0x00},
>> +    {0x00,0x18,{{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8},{0x61,0xDEB8}},0x02,0x00},
>> +    {0x00,0x20,{{0x63,0xDEB8},{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8}},0x03,0x00},
>> +    {0x00,0x28,{{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8}},0x04,0x00},
>> +    {0x00,0x30,{{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8}},0x05,0x00},
>>    }
>>  };
>>
>>
>
> Ping -- this update should be almost trivial to verify.
>
> (The issue only presents itself with the non-default -D CSM_ENABLE build
> flag, which is why people have not been complaining; but we should
> certainly adapt these initializers eventually.)

Hmm. I wish I didn't let this one slip by, as I just re-wrote it yesterday. :)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

Patch

diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c b/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
index af8896a..867b128 100644
--- a/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
+++ b/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
@@ -30,10 +30,10 @@  EFI_SETUP_BBS_MAP mSetupBbsMap[] = {
 // Global variables for System ROMs
 //
 #define SYSTEM_ROM_FILE_GUID \
-{ 0x1547B4F3, 0x3E8A, 0x4FEF, 0x81, 0xC8, 0x32, 0x8E, 0xD6, 0x47, 0xAB, 0x1A }
+{ 0x1547B4F3, 0x3E8A, 0x4FEF, { 0x81, 0xC8, 0x32, 0x8E, 0xD6, 0x47, 0xAB, 0x1A } }
 
 #define NULL_ROM_FILE_GUID \
-{ 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+{ 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
 
 SYSTEM_ROM_TABLE mSystemRomTable[] = {
   { SYSTEM_ROM_FILE_GUID,  1 },
@@ -82,12 +82,12 @@  EFI_LEGACY_PIRQ_TABLE PirqTableHead = {
     //          -- Pin 1 -- -- Pin 2 -- -- Pin 3 -- -- Pin 4 --
     // Bus  Dev  Reg   Map   Reg   Map   Reg   Map   Reg   Map
 
-    0x00,0x08,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x00,0x00,
-    0x00,0x10,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x01,0x00,
-    0x00,0x18,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x61,0xDEB8,0x02,0x00,
-    0x00,0x20,0x63,0xDEB8,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x03,0x00,
-    0x00,0x28,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x04,0x00,
-    0x00,0x30,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x05,0x00,
+    {0x00,0x08,{{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8}},0x00,0x00},
+    {0x00,0x10,{{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8}},0x01,0x00},
+    {0x00,0x18,{{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8},{0x61,0xDEB8}},0x02,0x00},
+    {0x00,0x20,{{0x63,0xDEB8},{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8}},0x03,0x00},
+    {0x00,0x28,{{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8}},0x04,0x00},
+    {0x00,0x30,{{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8}},0x05,0x00},
   }
 };