diff options
author | Reece R. Pollack <reece.pollack@linaro.org> | 2013-09-26 19:50:03 -0400 |
---|---|---|
committer | Steven Kinney <steven.kinney@amd.com> | 2014-04-02 14:54:05 -0500 |
commit | ac3dc24895a144be38b6e1176909a2f18dc9edf7 (patch) | |
tree | 649c72bbc9b3462bd36356b875c06e3e7a26fe72 | |
parent | 0749a2c998a4167ecf56f5a36471b5c04f0aa2e4 (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.c | 9 |
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) { |