summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReece R. Pollack <reece.pollack@linaro.org>2013-09-26 19:50:03 -0400
committerLeif Lindholm <leif.lindholm@linaro.org>2014-01-24 15:44:21 +0000
commitceba8e6cc4234289450a2d8856f93d1cf5092f56 (patch)
tree1632f2199e4e1befffee2abc85d588bf72f9f7e5
parent9e13f00f80afbf22b2746fd3de37a818ae118379 (diff)
downloadjuice-ceba8e6cc4234289450a2d8856f93d1cf5092f56.tar.gz
LAN9118: Fix RELEASE build and some uninit variables
The restructuring of the synchronization introduced or exposed some uninitialized variables. This patch fixes these. Also, the RELEASE build produced some warnings about an unused function used only from within DEBUG() statements. This patch conditionalizes this debug-only function on the same define used to control the expansion of the DEBUG macro. Signed-off-by: Reece R. Pollack <reece.pollack@linaro.org>
-rw-r--r--ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c b/ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c
index 010a8e473..92391323a 100644
--- a/ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c
+++ b/ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c
@@ -223,6 +223,7 @@ GenEtherCrc32 (
return ReverseBits (Remainder);
}
+#ifndef MDEPKG_NDEBUG
STATIC CONST CHAR16 *Mac2Str (EFI_MAC_ADDRESS *Mac)
{
static CHAR16 MacStr[18];
@@ -237,6 +238,7 @@ STATIC CONST CHAR16 *Mac2Str (EFI_MAC_ADDRESS *Mac)
Mac->Addr[3], Mac->Addr[4], Mac->Addr[5]);
return MacStr;
}
+#endif
// Function to read from MAC indirect registers
UINT32
@@ -1772,6 +1774,7 @@ SnpStationAddress (
IndirectMACWrite32 (INDIRECT_MAC_INDEX_ADDRL, (UINT32)((UINT32)NewMac->Addr[0]) | ((UINT32)NewMac->Addr[1] << 8) | ((UINT32)NewMac->Addr[2] << 16) | ((UINT32)NewMac->Addr[3] << 24));
IndirectMACWrite32 (INDIRECT_MAC_INDEX_ADDRH, (UINT32)((((UINT32)NewMac->Addr[4]) | ((UINT32)NewMac->Addr[5] << 8)) & 0xFFFF));
}
+ Status = EFI_SUCCESS;
// Restore TPL and return
exit_unlock:
@@ -1815,6 +1818,7 @@ SnpStatistics (
// Serialize access to data and registers
SavedTpl = gBS->RaiseTPL (LAN9118_TPL);
+ LanDriver = INSTANCE_FROM_SNP_THIS(Snp);
// Check that driver was started and initialised
if (Snp->Mode->State == EfiSimpleNetworkStarted) {
@@ -2080,6 +2084,8 @@ SnpTransmit (
// Serialize access to data and registers
SavedTpl = gBS->RaiseTPL (LAN9118_TPL);
+ LanDriver = INSTANCE_FROM_SNP_THIS(Snp);
+ TxCacheIndex = (-1);
if (Snp->Mode->State != EfiSimpleNetworkInitialized) {
ReturnUnlock (EFI_NOT_STARTED);
@@ -2101,9 +2107,6 @@ SnpTransmit (
ReturnUnlock (EFI_NOT_READY);
}
- LanDriver = INSTANCE_FROM_SNP_THIS(Snp);
- TxCacheIndex = (-1);
-
// Find a free entry in the TxCache array
for (TxCacheIndex = LAN9118_TX_CACHE_DEPTH - 1; TxCacheIndex >= 0; --TxCacheIndex) {
if (LanDriver->TxCache[TxCacheIndex] == NULL) {