From patchwork Thu Dec 1 17:56:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 86129 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp810467qgi; Thu, 1 Dec 2016 09:56:41 -0800 (PST) X-Received: by 10.98.158.155 with SMTP id f27mr39846204pfk.165.1480615001047; Thu, 01 Dec 2016 09:56:41 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id x70si997527pfj.101.2016.12.01.09.56.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 09:56:41 -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; 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 Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CB31381F38; Thu, 1 Dec 2016 09:56:40 -0800 (PST) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3FF4781F37 for ; Thu, 1 Dec 2016 09:56:40 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADBA5C05AA70; Thu, 1 Dec 2016 17:56:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-138.phx2.redhat.com [10.3.116.138]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB1HuaWp018501; Thu, 1 Dec 2016 12:56:38 -0500 From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 1 Dec 2016 18:56:29 +0100 Message-Id: <20161201175633.2538-2-lersek@redhat.com> In-Reply-To: <20161201175633.2538-1-lersek@redhat.com> References: <20161201175633.2538-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 01 Dec 2016 17:56:39 +0000 (UTC) Subject: [edk2] [PATCH 1/5] ArmVirtPkg/QemuFwCfgLib: remove superfluous InternalQemuFwCfgIsAvailable() 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: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" InternalQemuFwCfgIsAvailable() is an API that is incorrectly exposed by the "OvmfPkg/Include/Library/QemuFwCfgLib.h" library class header; the API is meant to be used internally to library instances (if it's needed at all). ArmVirtPkg's instance has no use for it actually, so simplify the code and remove the function definition. Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 31 ++++---------------- 1 file changed, 6 insertions(+), 25 deletions(-) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c index 8ecbe3fb5fe6..2fd8d9050566 100644 --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -75,25 +75,6 @@ typedef struct { /** - Returns a boolean indicating if the firmware configuration interface is - available for library-internal purposes. - - This function never changes fw_cfg state. - - @retval TRUE The interface is available internally. - @retval FALSE The interface is not available internally. -**/ -BOOLEAN -EFIAPI -InternalQemuFwCfgIsAvailable ( - VOID - ) -{ - return (BOOLEAN)(mFwCfgSelectorAddress != 0 && mFwCfgDataAddress != 0); -} - - -/** Returns a boolean indicating if the firmware configuration interface is available or not. @@ -109,7 +90,7 @@ QemuFwCfgIsAvailable ( VOID ) { - return InternalQemuFwCfgIsAvailable (); + return (BOOLEAN)(mFwCfgSelectorAddress != 0 && mFwCfgDataAddress != 0); } @@ -187,7 +168,7 @@ QemuFwCfgInitialize ( FwCfgDmaAddress = 0; } - if (InternalQemuFwCfgIsAvailable ()) { + if (QemuFwCfgIsAvailable ()) { UINT32 Signature; QemuFwCfgSelectItem (QemuFwCfgItemSignature); @@ -231,7 +212,7 @@ QemuFwCfgSelectItem ( IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem ) { - if (InternalQemuFwCfgIsAvailable ()) { + if (QemuFwCfgIsAvailable ()) { MmioWrite16 (mFwCfgSelectorAddress, SwapBytes16 ((UINT16)QemuFwCfgItem)); } } @@ -360,7 +341,7 @@ QemuFwCfgReadBytes ( IN VOID *Buffer ) { - if (InternalQemuFwCfgIsAvailable ()) { + if (QemuFwCfgIsAvailable ()) { InternalQemuFwCfgReadBytes (Size, Buffer); } else { ZeroMem (Buffer, Size); @@ -384,7 +365,7 @@ QemuFwCfgWriteBytes ( IN VOID *Buffer ) { - if (InternalQemuFwCfgIsAvailable ()) { + if (QemuFwCfgIsAvailable ()) { UINTN Idx; for (Idx = 0; Idx < Size; ++Idx) { @@ -494,7 +475,7 @@ QemuFwCfgFindFile ( UINT32 Count; UINT32 Idx; - if (!InternalQemuFwCfgIsAvailable ()) { + if (!QemuFwCfgIsAvailable ()) { return RETURN_UNSUPPORTED; }