summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReece R. Pollack <reece.pollack@linaro.org>2013-09-26 19:50:03 -0400
committerReece R. Pollack <reece.pollack@linaro.org>2013-09-26 19:50:03 -0400
commitefacd45e63d04fd0126014a965e4c23fcf5bf6df (patch)
tree09fb3405823c52bd7cc06e884c4bee02e4741837
parent06e741539970a3b4307a66d080cd13c3082c2952 (diff)
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) {