From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 819CB8197E for ; Tue, 10 Jan 2017 12:04:58 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP; 10 Jan 2017 12:04:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,344,1477983600"; d="scan'208";a="47562470" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga004.jf.intel.com with ESMTP; 10 Jan 2017 12:04:58 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.184]) by ORSMSX105.amr.corp.intel.com ([169.254.2.184]) with mapi id 14.03.0248.002; Tue, 10 Jan 2017 12:04:57 -0800 From: "Leahy, Leroy P" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" Thread-Topic: [Patch 3/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix GCC build issues Thread-Index: AQHSa23ETKrlTY1AOUSrYAqsiP2KpaEyIoPQ Date: Tue, 10 Jan 2017 20:04:56 +0000 Message-ID: References: <1484072204-35608-1-git-send-email-michael.d.kinney@intel.com> <1484072204-35608-4-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1484072204-35608-4-git-send-email-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWUwYWM1YmYtNjZiMy00MGE5LTkyZjAtNTg2MzA1ZjE2ZjEzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImhTZjdWUUd3SGdSdmpWSUdlMlpocnlnRk5pWlIzQ0NnaU52Rkt1dmZtc0E9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: Re: [Patch 3/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix GCC build issues X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:04:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Lee Leahy -----Original Message----- From: Kinney, Michael D=20 Sent: Tuesday, January 10, 2017 10:17 AM To: edk2-devel@lists.01.org Cc: Steele, Kelly ; Leahy, Leroy P Subject: [Patch 3/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix GCC build= issues https://bugzilla.tianocore.org/show_bug.cgi?id=3D335 Fix build issues with GCC49. There are local variables that may be used be= fore initialized in some paths. Cc: Kelly Steele Cc: Lee Leahy Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney --- .../Library/Tpm12DeviceLibAtmelI2c/TisPc.c | 18 +++++++++++---= ---- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c b/Quar= kPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c index 3aab530..894e1e3 100644 --- a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c +++ b/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c @@ -59,6 +59,8 @@ WriteTpmBufferMultiple ( UINTN Index; UINTN PartialLength; =20 + Status =3D EFI_SUCCESS; + I2CDeviceAddr.I2CDeviceAddress =3D ATMEL_I2C_TPM_SLAVE_ADDRESS; =20 DEBUG ((EFI_D_VERBOSE, "WriteTpmBufferMultiple: Addr=3D%02x Length=3D%0= 2x\n", I2CDeviceAddr.I2CDeviceAddress, Length)); @@ -112,6 +114,8 @@ ReadTp= mBufferMultiple ( UINTN Index; UINTN PartialLength; =20 + Status =3D EFI_SUCCESS; + I2CDeviceAddr.I2CDeviceAddress =3D ATMEL_I2C_TPM_SLAVE_ADDRESS; WriteLength =3D 0; =20 @@ -263,6 +267,13 @@ Tpm12SubmitCommand ( INT64 Delta; =20 // + // Initialize local variables + // + Start =3D 0; + End =3D 0; + Total =3D 0; + + // // Make sure response buffer is big enough to hold a response header // if (*OutputParameterBlockSize < sizeof (TPM_RSP_COMMAND_HDR)) { @@ -276,= 13 +287,6 @@ Tpm12SubmitCommand ( Current =3D GetPerformanceCounter(); =20 // - // Initialize local variables - // - Start =3D 0; - End =3D 0; - Total =3D 0; - - // // Retrieve the performance counter properties and compute the number of // performance counter ticks required to reach the maximum TIS timeout o= f // TIS_TIMEOUT_A. TIS_TIMEOUT_A is in microseconds. -- 2.6.3.windows.1