From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 819D2817B4 for ; Tue, 10 Jan 2017 10:16:46 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP; 10 Jan 2017 10:16:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,344,1477983600"; d="scan'208";a="51452774" Received: from mdkinney-mobl.amr.corp.intel.com ([10.254.91.144]) by orsmga005.jf.intel.com with ESMTP; 10 Jan 2017 10:16:46 -0800 From: Michael Kinney To: edk2-devel@lists.01.org Date: Tue, 10 Jan 2017 10:16:44 -0800 Message-Id: <1484072204-35608-4-git-send-email-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.6.3.windows.1 In-Reply-To: <1484072204-35608-1-git-send-email-michael.d.kinney@intel.com> References: <1484072204-35608-1-git-send-email-michael.d.kinney@intel.com> Subject: [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 18:16:46 -0000 https://bugzilla.tianocore.org/show_bug.cgi?id=335 Fix build issues with GCC49. There are local variables that may be used before 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/QuarkPlatformPkg/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; + Status = EFI_SUCCESS; + I2CDeviceAddr.I2CDeviceAddress = ATMEL_I2C_TPM_SLAVE_ADDRESS; DEBUG ((EFI_D_VERBOSE, "WriteTpmBufferMultiple: Addr=%02x Length=%02x\n", I2CDeviceAddr.I2CDeviceAddress, Length)); @@ -112,6 +114,8 @@ ReadTpmBufferMultiple ( UINTN Index; UINTN PartialLength; + Status = EFI_SUCCESS; + I2CDeviceAddr.I2CDeviceAddress = ATMEL_I2C_TPM_SLAVE_ADDRESS; WriteLength = 0; @@ -263,6 +267,13 @@ Tpm12SubmitCommand ( INT64 Delta; // + // Initialize local variables + // + Start = 0; + End = 0; + Total = 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 = GetPerformanceCounter(); // - // Initialize local variables - // - Start = 0; - End = 0; - Total = 0; - - // // Retrieve the performance counter properties and compute the number of // performance counter ticks required to reach the maximum TIS timeout of // TIS_TIMEOUT_A. TIS_TIMEOUT_A is in microseconds. -- 2.6.3.windows.1