From patchwork Fri Oct 28 10:44:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 79889 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1103637qge; Fri, 28 Oct 2016 03:44:52 -0700 (PDT) X-Received: by 10.99.132.194 with SMTP id k185mr19572879pgd.171.1477651492898; Fri, 28 Oct 2016 03:44:52 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id wx5si10716640pab.108.2016.10.28.03.44.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2016 03:44:52 -0700 (PDT) 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; 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 dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1310481D11; Fri, 28 Oct 2016 03:44:52 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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 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: [edk2] [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: , Cc: ryan.harkin@linaro.org, lersek@redhat.com, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm 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