From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 0287081D40 for ; Fri, 28 Oct 2016 05:40:24 -0700 (PDT) Received: by mail-wm0-x22c.google.com with SMTP id 140so74071301wmv.0 for ; Fri, 28 Oct 2016 05:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oPfLc2x2bQ8LgMD20agOcdccf9JqWPOTqTFQva5SjX4=; b=kshb7bFzn9KVYgtNTp5qUrgKNkAg2k+Okv98UKUk+6AjcN0aUWTf2H9cHFyVv5xzXj 55i5irY/s1Bt1MbB/K0byp0pfJ7sp9FnxJe6oTUjtvPa4DjOZ1BlU9ZgU+HC0PR7Q3H7 olgIOzrQeu0ajyZlaY7VCxzTQUjiiP0V3+wg8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oPfLc2x2bQ8LgMD20agOcdccf9JqWPOTqTFQva5SjX4=; b=ZsYMU/UmtD2ixo4brHlWjoTyYkI+d1miLdyMljTVyyJm1bwFRMjq58tGI44jEvdrUA skydocMkm0vSdCE1nksEzc48atKAt620BHTCuYfBDaYb2g61Rc1NIX/sXevYt2Pjl1UP TVWoZey2SIElR+a6J4436FU34WfQtA1/xzS1KpTP3jWPAlGAUZbhCHRcIgh7jclqqihC gZigVoe/214a1S3LPANl7ZHxaMRFpVxgGpRPNoOKgDohlEYmqJZMun8jsdKD/qnBuQab rmpt+4vpFvarsDrnpmbQ31tSmHtZdhqwxOuklF1ZkzcxYDKH48S0KHqDfNDNx7H/85cM Pwvg== X-Gm-Message-State: ABUngvega8FYaS4IzVWMQaEubCenD6Ztq5DUOgKIRP5Rj81nBaBqvrd/6uGzVJCuPmx5B3en X-Received: by 10.28.9.195 with SMTP id 186mr3809304wmj.117.1477658419822; Fri, 28 Oct 2016 05:40:19 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 194sm9424749wmj.0.2016.10.28.05.40.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2016 05:40:19 -0700 (PDT) Date: Fri, 28 Oct 2016 13:40:17 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, lersek@redhat.com, ryan.harkin@linaro.org Message-ID: <20161028124017.GH1161@bivouac.eciton.net> References: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> <1477651478-16830-2-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1477651478-16830-2-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH v2 1/9] EmbeddedPkg/AndroidFastbootTransportTcpDxe: remove broken hostname handling X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 12:40:24 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 28, 2016 at 11:44:30AM +0100, Ard Biesheuvel wrote: > The fastboot TCP connection setup routine retrieves a hostname from a > UEFI variable 'hostname' that is scoped under a GUID gEfiHostnameVariableGuid > whose definition is missing from the code. Since the hostname is only printed > and then discarded, let's just drop the whole thing. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel It also gets rid of some needlessly hardcoded buffers, which I'm all for - so: Reviewed-by: Leif Lindholm > --- > EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c | 23 -------------------- > EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf | 3 --- > 2 files changed, 26 deletions(-) > > diff --git a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c > index 8ec78aeb534e..7c008ac9722e 100644 > --- a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c > +++ b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c > @@ -27,8 +27,6 @@ > #include > #include > > -#include > - > #define IP4_ADDR_TO_STRING(IpAddr, IpAddrString) UnicodeSPrint ( \ > IpAddrString, \ > 16 * 2, \ > @@ -307,9 +305,6 @@ TcpFastbootTransportStart ( > EFI_HANDLE *HandleBuffer; > EFI_IP4_MODE_DATA Ip4ModeData; > UINTN NumHandles; > - UINTN HostnameSize = 256; > - CHAR8 Hostname[256]; > - CHAR16 HostnameUnicode[256] = L""; > CHAR16 IpAddrString[16]; > UINTN Index; > > @@ -442,28 +437,10 @@ TcpFastbootTransportStart ( > // > IP4_ADDR_TO_STRING (Ip4ModeData.ConfigData.StationAddress, IpAddrString); > > - // Look up hostname > - Status = gRT->GetVariable ( > - L"Hostname", > - &gEfiHostnameVariableGuid, > - NULL, > - &HostnameSize, > - &Hostname > - ); > - if (!EFI_ERROR (Status) && HostnameSize != 0) { > - AsciiStrToUnicodeStr (Hostname, HostnameUnicode); > - } > - > - // Hostname variable is not null-terminated. > - Hostname[HostnameSize] = L'\0'; > - > mTextOut->OutputString (mTextOut, L"TCP Fastboot transport configured."); > mTextOut->OutputString (mTextOut, L"\r\nIP address: "); > mTextOut->OutputString (mTextOut ,IpAddrString); > mTextOut->OutputString (mTextOut, L"\r\n"); > - mTextOut->OutputString (mTextOut, L"\r\nhostname: "); > - mTextOut->OutputString (mTextOut, HostnameUnicode); > - mTextOut->OutputString (mTextOut, L"\r\n"); > > // > // Start listening for a connection > diff --git a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf > index 4d777934e5a4..89ff556b40ca 100644 > --- a/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf > +++ b/EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf > @@ -47,8 +47,5 @@ [Packages] > MdeModulePkg/MdeModulePkg.dec > EmbeddedPkg/EmbeddedPkg.dec > > -[Guids] > - gEfiHostnameVariableGuid > - > [FixedPcd] > gEmbeddedTokenSpaceGuid.PcdAndroidFastbootTcpPort > -- > 2.7.4 >