summaryrefslogtreecommitdiff
path: root/QuarkPlatformPkg
diff options
context:
space:
mode:
authorMichael Kinney <michael.d.kinney@intel.com>2017-01-10 09:41:01 -0800
committerMichael Kinney <michael.d.kinney@intel.com>2017-01-11 11:11:30 -0800
commitdf3f02df1bde40c2a0d486d3ca6bd529c3654049 (patch)
tree7a5457189917ec88f54630f088202e487025649f /QuarkPlatformPkg
parent39dfd12de48d01023ef293c37f524b8c2137f7c1 (diff)
downloadedk2-platforms-df3f02df1bde40c2a0d486d3ca6bd529c3654049.tar.xz
QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix GCC build issues
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 <kelly.steele@intel.com> Cc: Lee Leahy <leroy.p.leahy@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Lee Leahy <leroy.p.leahy@intel.com>
Diffstat (limited to 'QuarkPlatformPkg')
-rw-r--r--QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c b/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c
index 3aab530643..894e1e3674 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.