From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (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 1117C81CCA for ; Fri, 28 Oct 2016 03:44:50 -0700 (PDT) Received: by mail-wm0-x231.google.com with SMTP id p190so767838wmp.1 for ; Fri, 28 Oct 2016 03:44:50 -0700 (PDT) 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; bh=nFJMsqX8HF2Uz9afFPlbt4ifU5fQ+4A/rPuUY2OZQFQ=; b=ctU2G8iNeDzMP8cgU10Gk7mYS1ckTcJWYj2FumcjSb/aO/ijiYnsehRXdVAMoSjaQa bhuAGonAkhFrBjhlM/6PsOg1WZhCQYmluGhpRupbn6d+lOdxJe7tN6Hv3u6LoBfyHS0H VT612Q1CIcTw082MHk+WHaUB234I2M2hQAZfI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nFJMsqX8HF2Uz9afFPlbt4ifU5fQ+4A/rPuUY2OZQFQ=; b=Yxk5hzvWGAjAqBe56fv1FN/dNQoZ6wC0bjp7D3E2uTCjhmYLlbfIOjceY6iadcSIGq 5TbQdeMfEnhT53nvMGkkgnHBbVvFSLBbr7lmvMj+sow/TvP1RoypEs0kH42SDKnhY9gp e+tZNZm4YTRqYncqtmeduFIguGfvXD2lGLliAmRjS9n2epzxXB+ve+JhK/eaXJ6ok9Uk a3c80zxO79hOLA9BiYylziIxuHYl0Qod2brlWYUaI5W95sWzb9uxS3INGayqgGBFOYFt 0yxtsXPJD872tNl9Hqvwm0nuiZWIHnV/bigC2Rjr9ioAk2Q4cBbHa+GDh49AUGBkfN9A 2RJg== X-Gm-Message-State: ABUngvfJYyqaft6W1wjAk2zUYhAMywaBDMDtJeqkHWbVW0v20bCJIrvf+pSjadA/0kRCzHYa X-Received: by 10.194.9.230 with SMTP id d6mr10715658wjb.98.1477651488733; Fri, 28 Oct 2016 03:44:48 -0700 (PDT) Received: from localhost.localdomain ([105.150.227.229]) by smtp.gmail.com with ESMTPSA id 184sm57730wms.4.2016.10.28.03.44.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Oct 2016 03:44:48 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Cc: lersek@redhat.com, ryan.harkin@linaro.org, Ard Biesheuvel Date: Fri, 28 Oct 2016 11:44:30 +0100 Message-Id: <1477651478-16830-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> References: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [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 10:44:50 -0000 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 --- 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