From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.128.65; helo=mail-wm1-f65.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 3864321A00AE6 for ; Wed, 7 Nov 2018 01:15:15 -0800 (PST) Received: by mail-wm1-f65.google.com with SMTP id u13-v6so15051624wmc.4 for ; Wed, 07 Nov 2018 01:15:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0L43jWzFw/VqqVFJvVjXnhVhRq3o89Nkj5cfxkZ09jk=; b=CrmNrzSeBtemfXOZdRI8P6DEtnXIIoca01boolRDFGEAKgEFLTngLgVbf2dyohZNM4 oKEZVMqkKq4UrDzb2mHh9SVG1+n+cB82jcZMmxP4QPSvzacEmBfHmiWnydvju5YUN+t4 ABNpiDubwR7leiArKKMOFG/vbTOCQIModfsyAHsKPrQjXcOA0MtupidY5j2l2nqsLJt4 VNHz/8gchYrGfe8eJ3ySciiJPSSGGaFMfe4ZfIDfuoqGdVfqdX3o4gysqmRjibrsxWqc dnw4cal95g4JmXOC0zSx4mDz2YbRLFCy76qF0DwYcHBO1Kjy5rCY7UG5SF5tv+CQauhh BjDw== X-Gm-Message-State: AGRZ1gIS6LuQAn/W1UGs3EXVEEwJOuyO+ttfEHylgoMNNZykOBj7bxXJ EwKP18nXGp8EypqtP50mYEySOg== X-Google-Smtp-Source: AJdET5f0OzJWGMYo4lkXWTQBA/GZKCFCccqA9hzIZPabcLl0f5wzwvB7L1Y33kT129AzFyE2P1Es1g== X-Received: by 2002:a1c:cb01:: with SMTP id b1-v6mr1214451wmg.42.1541582113641; Wed, 07 Nov 2018 01:15:13 -0800 (PST) Received: from ?IPv6:2a01:cb1d:8a0a:f500:48c1:8eab:256a:caf9? ([2a01:cb1d:8a0a:f500:48c1:8eab:256a:caf9]) by smtp.gmail.com with ESMTPSA id y2-v6sm83119wrh.53.2018.11.07.01.15.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 01:15:13 -0800 (PST) To: Ard Biesheuvel , edk2-devel@lists.01.org Cc: michael.d.kinney@intel.com, eric.jin@intel.com References: <20181106175833.26964-1-ard.biesheuvel@linaro.org> <20181106175833.26964-20-ard.biesheuvel@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <88c38519-a8d3-643f-a7a6-909737d8ed3b@redhat.com> Date: Wed, 7 Nov 2018 10:08:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181106175833.26964-20-ard.biesheuvel@linaro.org> Subject: Re: [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: Wed, 07 Nov 2018 09:15:15 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit On 6/11/18 18:58, Ard Biesheuvel wrote: > 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) */ This context is easier to understand when looking at the whole function. Reviewed-by: Philippe Mathieu-Daudé > > > 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, >