From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::42a; helo=mail-wr1-x42a.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0B08F2118D923 for ; Tue, 6 Nov 2018 09:59:16 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id z13-v6so12188568wrs.3 for ; Tue, 06 Nov 2018 09:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aEOcVCBKAYXiJbHb6DkbbjDsarByTZ6OFYsEVeldKak=; b=PK0MvVFv7gVhJMPPrLIrahg6a/P/aiXi4xSHfgRS3+qFnqGft7oGvcY4576/9yHV/8 aaNYmtwa5mDqvLNHCMNt6hx3GrT1heV3+wQjWI6uvBq98MfSYc0/4cRWbNXu8MGxkeCy qGUU6pTsqRxDolfNvf8/xFjPP26wQ7AbRb644= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aEOcVCBKAYXiJbHb6DkbbjDsarByTZ6OFYsEVeldKak=; b=mcOO/HWkjHrJ6NoHzuoNQN+r21jGW6KI9VI9EqtzDaviZdmEC9pgAUh81lW1Ve3fpm DsOd84eLU3IK97922eLG8KUMRN+GkQThlYZwDHQgda+CT13rc5YlE0ihYKTUr6Zg5jA8 gEDhncXrulwIkx+sIfq70dtweS6iQd6eI7QXIh5nE+iH7PQPR400Lr9vH6M/GNP8l3/t df/w1C5txbtvp0BiA8h918wtu2ymKebJxrrtbpWK1XVCl8n28DX+1BTr80etfb6bhXAZ sZtE1qnUPznEXt45vL50w4QBtSf06M0YVoMBLPwa+hBWrPo/fvMCMC0UrLXqSCsASg9e iDIg== X-Gm-Message-State: AGRZ1gKg3h17spvERRCSgKzAHct3yO2g6X1unF9mDZYFDIR4Wa6sehZp XHfi1salaEvf6Mc9rPzQeQWVSUGW6U0= X-Google-Smtp-Source: AJdET5ebU/jcDrk8fw6RKz8/DuUNJyff4kwEnKZKW4zrzFfy3DmXK3q1HppB3NF+mu5wSbhlCmezRw== X-Received: by 2002:adf:94e2:: with SMTP id 89-v6mr23951548wrr.25.1541527154095; Tue, 06 Nov 2018 09:59:14 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) by smtp.gmail.com with ESMTPSA id 134-v6sm2971522wmp.6.2018.11.06.09.59.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 09:59:13 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: maciej.rabeda@intel.com, michael.d.kinney@intel.com, eric.jin@intel.com, leif.lindholm@linaro.org, Ard Biesheuvel Date: Tue, 6 Nov 2018 18:58:33 +0100 Message-Id: <20181106175833.26964-20-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181106175833.26964-1-ard.biesheuvel@linaro.org> References: <20181106175833.26964-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [PATCH edk2-staging 19/19] IntelUndiPkg/GigUndiDxe: remove or reorganize unused variables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 17:59:16 -0000 Content-Transfer-Encoding: 8bit Drop variables that are assigned but never used, or move them into a conditional preprocessor block if the only references occur from such code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- IntelUndiPkg/GigUndiDxe/DriverDiagnostics.c | 2 -- IntelUndiPkg/GigUndiDxe/HiiInternalLib.c | 2 -- IntelUndiPkg/GigUndiDxe/e1000.c | 16 +++++++--------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/IntelUndiPkg/GigUndiDxe/DriverDiagnostics.c b/IntelUndiPkg/GigUndiDxe/DriverDiagnostics.c index f6152cd24c59..af8aaa797e68 100644 --- a/IntelUndiPkg/GigUndiDxe/DriverDiagnostics.c +++ b/IntelUndiPkg/GigUndiDxe/DriverDiagnostics.c @@ -1123,11 +1123,9 @@ GigUndiRunPhyLoopback ( UINT64 FreeTxBuffer[DEFAULT_TX_DESCRIPTORS]; UINT32 j; UINT32 i; - struct e1000_hw *Hw; Status = EFI_SUCCESS; j = 0; - Hw = &GigAdapterInfo->Hw; while (j < PHY_LOOPBACK_ITERATIONS) { Status = E1000Transmit ( diff --git a/IntelUndiPkg/GigUndiDxe/HiiInternalLib.c b/IntelUndiPkg/GigUndiDxe/HiiInternalLib.c index 2aacb63ca158..690d8314be74 100644 --- a/IntelUndiPkg/GigUndiDxe/HiiInternalLib.c +++ b/IntelUndiPkg/GigUndiDxe/HiiInternalLib.c @@ -197,7 +197,6 @@ GetNextRequestElement ( ) { EFI_STRING StringPtr; - EFI_STRING TmpPtr; EFI_STATUS Status; UINTN Length; UINT8 * TmpBuffer; @@ -227,7 +226,6 @@ GetNextRequestElement ( } // Back up the header of one - TmpPtr = StringPtr; StringPtr += StrLen (L"OFFSET="); diff --git a/IntelUndiPkg/GigUndiDxe/e1000.c b/IntelUndiPkg/GigUndiDxe/e1000.c index 28c900e3ad63..3d4a21c62d77 100644 --- a/IntelUndiPkg/GigUndiDxe/e1000.c +++ b/IntelUndiPkg/GigUndiDxe/e1000.c @@ -412,7 +412,6 @@ E1000Transmit ( E1000_TRANSMIT_DESCRIPTOR *TransmitDescriptor; UINT32 i; INT16 WaitMsec; - EFI_STATUS Status; UNDI_DMA_MAPPING *TxBufMapping; TxBufMapping = &GigAdapter->TxBufferMappings[GigAdapter->CurTxInd]; @@ -483,7 +482,7 @@ E1000Transmit ( TxBufMapping->Size = TxBuffer->DataLen + TxBuffer->MediaheaderLen; // Make the Tx buffer accessible for adapter over DMA - Status = UndiDmaMapMemoryRead ( + UndiDmaMapMemoryRead ( GigAdapter->PciIo, TxBufMapping ); @@ -594,20 +593,21 @@ E1000Receive ( E1000_RECEIVE_DESCRIPTOR *ReceiveDescriptor; ETHER_HEADER * EtherHeader; PXE_STATCODE StatCode; - UINT16 i; UINT16 TempLen; +#if (DBG_LVL & RX) + UINT16 i; UINT8 * PacketPtr; #if (DBG_LVL & CRITICAL) -#if (DBG_LVL & RX) UINT32 Rdh; UINT32 Rdt; -#endif /* (DBG_LVL & RX) */ + #endif /* (DBG_LVL & CRITICAL) */ + i = 0; +#endif /* (DBG_LVL & RX) */ PacketType = PXE_FRAME_TYPE_NONE; StatCode = PXE_STATCODE_NO_DATA; - i = 0; // acknowledge the interrupts E1000_READ_REG (&GigAdapter->Hw, E1000_ICR); @@ -679,9 +679,9 @@ E1000Receive ( TempLen ); +#if (DBG_LVL & RX) PacketPtr = (UINT8 *) (UINTN) CpbReceive->BufferAddr; -#if (DBG_LVL & RX) DEBUGPRINT (RX, ("Packet Data \n")); for (i = 0; i < TempLen; i++) { DEBUGPRINT (RX, ("%x ", PacketPtr[i])); @@ -1569,13 +1569,11 @@ E1000Inititialize ( GIG_DRIVER_DATA *GigAdapter ) { - UINT32 * TempBar; PXE_STATCODE PxeStatcode; DEBUGPRINT (E1000, ("E1000Inititialize\n")); PxeStatcode = PXE_STATCODE_SUCCESS; - TempBar = NULL; ZeroMem ( (VOID *)(UINTN)GigAdapter->RxRing.UnmappedAddress, -- 2.19.1