From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: rangasai.v.chaganty@intel.com) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Thu, 12 Sep 2019 14:45:34 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2019 14:45:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,489,1559545200"; d="scan'208";a="360582151" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga005.jf.intel.com with ESMTP; 12 Sep 2019 14:45:27 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 12 Sep 2019 14:45:26 -0700 Received: from fmsmsx104.amr.corp.intel.com ([169.254.3.101]) by FMSMSX109.amr.corp.intel.com ([169.254.15.48]) with mapi id 14.03.0439.000; Thu, 12 Sep 2019 14:45:26 -0700 From: "Chaganty, Rangasai V" To: "Kubacki, Michael A" , "devel@edk2.groups.io" CC: "Bi, Dandan" , "Gao, Liming" Subject: Re: [edk2-platforms][PATCH V2 1/1] AdvancedFeaturePkg/Ipmi: Fix GCC Build Failures Thread-Topic: [edk2-platforms][PATCH V2 1/1] AdvancedFeaturePkg/Ipmi: Fix GCC Build Failures Thread-Index: AQHVabCe9evqtoNZLk+MquqwgJYJhacokvFg Date: Thu, 12 Sep 2019 21:45:25 +0000 Message-ID: References: <20190912212418.33316-1-michael.a.kubacki@intel.com> In-Reply-To: <20190912212418.33316-1-michael.a.kubacki@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWU0ZDIzMmYtMjgyMC00NWNkLWI4ZDktNzBkODA0MjJmN2JjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWW5ubHFJU2NGS3k2YmhMZ3pHYmxPdU1ON2FMMERhQ2lYMGxjTEc5Y0tpTEJ2d2hDRTNGaU9sS0YyTWtYdzJ1RSJ9 x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Return-Path: rangasai.v.chaganty@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty -----Original Message----- From: Kubacki, Michael A=20 Sent: Thursday, September 12, 2019 2:24 PM To: devel@edk2.groups.io Cc: Bi, Dandan ; Chaganty, Rangasai V ; Gao, Liming Subject: [edk2-platforms][PATCH V2 1/1] AdvancedFeaturePkg/Ipmi: Fix GCC Bu= ild Failures REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2059 These build failures can be reproduced simply by building the AdvancedFeatu= rePkg.dsc file in GCC5. To build the whole package DSC (not pull individual= features into other packages), set the WORKSPACE variable to the edk2 dire= ctory in the workspace as is done by executing edksetup.sh then create the = PACKAGES_PATH variable and add the Platform/Intel and Silicon/Intel directo= ries to the variable value. Then start the build of AdvancedFeaturePkg.dsc: 'build -p AdvancedFeaturePkg/AdvancedFeaturePkg.dsc' This change corrects the following issues reported by GCC: * BmcAcpi.c - Cast the pointer actual parameter types passed to functions to the formal parameter type. * OsWdt.c - Return the Status variable as the function return value in DriverInit (). * PeiIpmiInit.c - Return the Status variable as the function return value in PeimIpmiInterfaceInit () * SolStatus.c - Remove the unused variable SOLEnabled. The variable was not removed after a code refactoring. All future contributions to AdvancedFeaturePkg must successfully build in G= CC after this change. Cc: Dandan Bi Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c | 16 +++++++= ++---- Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.c | 15 ++++++-= ----- Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c | 9 ++++---= - Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.c | 24 +++++++= +------------ 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c b/Pla= tform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c index 3b330da160..990b4b9e83 100644 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c +++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c @@ -1,7 +1,7 @@ /** @file BMC ACPI. =20 -Copyright (c) 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -154,7 +154,7 @@ UpdateDeviceSsdtTable ( IoRsc->BaseAddressMax =3D PcdGet16(PcdIpmiIoBaseAddress); } } - =20 + return EFI_SUCCESS; } =20 @@ -202,7 +202,7 @@ BmcAcpiEntryPoint ( // // Locate the firmware volume protocol // - Status =3D LocateSupportProtocol (&gEfiFirmwareVolume2ProtocolGuid, &FwV= ol, 1); + Status =3D LocateSupportProtocol (&gEfiFirmwareVolume2ProtocolGuid,=20 + (VOID **) &FwVol, 1); if (EFI_ERROR (Status)) { return Status; } @@ -216,7 +216,15 @@ BmcAcpiEntryPoint ( while (!EFI_ERROR (Status)) { CurrentTable =3D NULL; =20 - Status =3D FwVol->ReadSection (FwVol, &gEfiCallerIdGuid, EFI_SECTION_R= AW, Instance, &CurrentTable, (UINTN *) &Size, &FvStatus); + Status =3D FwVol->ReadSection ( + FwVol, + &gEfiCallerIdGuid, + EFI_SECTION_RAW, + Instance, + (VOID **) &CurrentTable, + (UINTN *) &Size, + &FvStatus + ); if (!EFI_ERROR (Status)) { // // Perform any table specific updates. diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.c = b/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.c index 8245aac8e9..062d20c44e 100644 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.c +++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.c @@ -1,7 +1,7 @@ /** @file - IPMI stack initialization in PEI. + IPMI stack initialization in PEI. =20 -Copyright (c) 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -27,7 +27,7 @@ Routine Description: =20 Arguments: =20 -Returns:=20 +Returns: Status =20 --*/ @@ -35,7 +35,7 @@ Returns: EFI_STATUS Status; IPMI_GET_DEVICE_ID_RESPONSE BmcInfo; UINT32 Retries; - =20 + // // Set up a loop to retry for up to 30 seconds. Calculate retries not ti= meout // so that in case KCS is not enabled and EfiIpmiSendCommand() returns @= @ -71,9 +71,10 @@ Returns: The entry point of the Ipmi PEIM. =20 @param FileHandle Handle of the file being invoked. - @param PeiServices Describes the list of possible PEI Services.=20 + @param PeiServices Describes the list of possible PEI Services. =20 @retval EFI_SUCCESS Indicates that Ipmi initialization completed succe= ssfully. + @retval Others Indicates that Ipmi initialization could not compl= ete successfully. **/ EFI_STATUS EFIAPI @@ -85,11 +86,11 @@ PeimIpmiInterfaceInit ( BOOLEAN UpdateMode; EFI_STATUS Status; =20 - DEBUG((EFI_D_ERROR,"IPMI Peim:Get BMC Device Id\n")); + DEBUG ((DEBUG_INFO, "IPMI Peim:Get BMC Device Id\n")); =20 // // Get the Device ID and check if the system is in Force Update mode. // Status =3D GetDeviceId (&UpdateMode); - return EFI_SUCCESS; + return Status; } diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c b/Platfor= m/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c index c5612d4b6d..25139eadba 100644 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c +++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c @@ -1,7 +1,7 @@ /** @file IPMI Os watchdog timer Driver. =20 -Copyright (c) 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -93,11 +93,12 @@ Arguments: SystemTable - Pointer to the System Table =20 Returns: - EFI_SUCCESS - Protocol successfully started and installed. + @retval EFI_SUCCESS Protocol successfully started and installe= d. + @retval EFI_OUT_OF_RESOURCES The event could not be allocated. =20 --*/ { - EFI_STATUS Status; + EFI_STATUS Status; =20 Status =3D gBS->CreateEvent ( EVT_SIGNAL_EXIT_BOOT_SERVICES, @@ -107,5 +108,5 @@ Retur= ns: &mExitBootServicesEvent ); =20 - return EFI_SUCCESS; + return Status; } diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.c b= /Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.c index 69479bdbf5..47bec1975a 100644 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.c +++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.c @@ -1,7 +1,7 @@ /** @file IPMI Serial Over Lan Driver. =20 -Copyright (c) 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -70,7 +70,7 @@ GetSOLStatus ( if (Status =3D=3D EFI_SUCCESS) { *Data =3D GetConfigurationParametersResponse.ParameterData[0]; } - =20 + return Status; } =20 @@ -132,11 +132,11 @@ SolStatusEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable ) /*++ - =20 + Routine Description: This is the standard EFI driver point. This function intitializes the private data required for creating SOL Status Driver. - =20 + Arguments: ImageHandle - Handle for the image of this driver SystemTable - Pointer to the EFI System Table @@ -149,18 +149,14 @@ SolStatusEntryPoint ( { EFI_STATUS Status =3D EFI_SUCCESS; UINT8 Channel; - BOOLEAN Enabled =3D FALSE; - BOOLEAN SOLEnabled =3D FALSE; - - for (Channel =3D 1; Channel <=3D PcdGet8(PcdMaxSOLChannels); Channel++) = { - Status =3D GetSOLStatus (Channel, IPMI_SOL_CONFIGURATION_PARAMETER_SOL= _ENABLE, &Enabled); + BOOLEAN SolEnabled =3D FALSE; + + for (Channel =3D 1; Channel <=3D PcdGet8 (PcdMaxSOLChannels); Channel++)= { + Status =3D GetSOLStatus (Channel, IPMI_SOL_CONFIGURATION_PARAMETER_SOL= _ENABLE, &SolEnabled); if (Status =3D=3D EFI_SUCCESS) { - if (Enabled =3D=3D TRUE) { - SOLEnabled =3D TRUE; - } =20 - DEBUG ((EFI_D_ERROR, "SOL enabling status for channel %x is %x\n", C= hannel, Enabled)); + DEBUG ((DEBUG_ERROR, "SOL enabling status for channel %x is %x\n", C= hannel, SolEnabled)); } else { - DEBUG ((EFI_D_ERROR, "Failed to get channel %x SOL status from BMC!,= status is %x\n", Channel, Status)); + DEBUG ((DEBUG_ERROR, "Failed to get channel %x SOL status from BMC!,= status is %x\n", Channel, Status)); } } =20 --=20 2.16.2.windows.1