From patchwork Tue Nov 6 17:58:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 150321 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4193080ljp; Tue, 6 Nov 2018 10:00:06 -0800 (PST) X-Google-Smtp-Source: AJdET5cP9zq2ZB9XrqLV8Kh/KcVvsxqUoks0R1jqXss60rAauJSHH16n/i0GetU4TKFGIT9YnAjo X-Received: by 2002:a63:2bc9:: with SMTP id r192mr25088939pgr.172.1541527206801; Tue, 06 Nov 2018 10:00:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541527206; cv=none; d=google.com; s=arc-20160816; b=Rrj/FuDMAJ39ROxnmeHHFXjVrEfpul1RDCLrKdoDDpi9ZPyYMj6zOdsqhfz6dKZYXq phwoidaMUW/TpGpixE8bmD90/3x4S6J+bHSeOxQuG5oe8dZIdKU0fvlB9fveQ6ccTfet f/KpIWn98mrCCzQlKpholhhNJsyD9FtTWB8ttYS9uexQ24HNe3pqG85m7S9vqPYk5q79 S10jC4F2S3z/0blqibRsgGD34PKryzkcKCYpJ46OAU/fVX8qOt8MW1iJ/6jc1divUZzT jEfMzg4YSbih1TcbzG5O/PC3naIqR01bmYirEbGJLbk1SQpGxQj4uzgrkpE7SnGDbLV9 lwSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=XD47XTtGiC0Yx5gxEUQZqpCCpSTWwdPJeKJZZiqc8OE=; b=fUjvtwO9MntKkDZ4NYlrfXy5Q5O5U1Qa56I4d4xs73zNknpwjFZLN97oWqYPOLjv3C e4Nya6VkUAOg3+6lCF2ScRYsIGgOW/KeQHLa7FI43e+zpnBStPNZA8Xd/4JLmLyyOaEO 8IqHg0y1nkbJp5sD1kIuWorgRhjYTGKmhvcFqBBvcjtifOTbwVMyuPaIkeqDpy41p9Ly 2QgOdP4GgEz927umAFJnP1JvBqT8YB5L+EBsFMujHe9G4qi0C4wdY2Yb76SDF9znzGjf UjY3z6FtrcesET8btLgKh7Qm2eL1BipslQjjfOFlTBNTTu7UxtU+ATQ2IsiruJE2gBI6 ualg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PK0MvVFv; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id az12-v6si2452283plb.166.2018.11.06.10.00.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 10:00:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PK0MvVFv; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E9DFB2118D924; Tue, 6 Nov 2018 09:59:17 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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-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 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: [edk2] [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: , Cc: michael.d.kinney@intel.com, eric.jin@intel.com Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.19.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ryszard Knop 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,