From: Michael Kinney <michael.d.kinney@intel.com>
To: edk2-devel@lists.01.org
Subject: [Patch 3/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix GCC build issues
Date: Tue, 10 Jan 2017 10:16:44 -0800 [thread overview]
Message-ID: <1484072204-35608-4-git-send-email-michael.d.kinney@intel.com> (raw)
In-Reply-To: <1484072204-35608-1-git-send-email-michael.d.kinney@intel.com>
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>
---
.../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
next prev parent reply other threads:[~2017-01-10 18:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-10 18:16 [Patch 0/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix TPM issues Michael Kinney
2017-01-10 18:16 ` [Patch 1/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Remove PP Check Michael Kinney
2017-01-10 20:03 ` Leahy, Leroy P
2017-01-10 18:16 ` [Patch 2/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix SubmitCommand() out size Michael Kinney
2017-01-10 20:03 ` Leahy, Leroy P
2017-01-10 18:16 ` Michael Kinney [this message]
2017-01-10 20:04 ` [Patch 3/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix GCC build issues Leahy, Leroy P
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1484072204-35608-4-git-send-email-michael.d.kinney@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox