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 E8B9F81F4D for ; Fri, 2 Dec 2016 02:58:27 -0800 (PST) Received: by mail-wm0-x22c.google.com with SMTP id f82so12248638wmf.1 for ; Fri, 02 Dec 2016 02:58:27 -0800 (PST) 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=3RJg/vExVgWA29R2uPd0YNhJDbE1klP6cCHHUKCd47E=; b=fEXc5MWVUEPJVQXEa5y5zpQx9gEPtgJcofTTcDwVR78fLwgrjwddmbTR/0yjTdIdhy 8/0hH1XQ2InJF8MbP9aDN6sxeFGROabrHGVf7+KW3pStcsqKi5YDozbKnxN2CxQTKHWS sfGRiOM5Qfqfn+Fx2Vi3c0Rlo8FaDnpuUPE/k= 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=3RJg/vExVgWA29R2uPd0YNhJDbE1klP6cCHHUKCd47E=; b=KR6OOu8AnljYTBadZqbP7cEAHdrWb62Q+anG/yoMBzQ7oROXdOWuBYMo9kP1KO6KU5 uz8VQoXlytZuj4lMS7OM6FsWPqms9nLCWDiCJCK4MatyiQpxVwQEdc++tTFlfU80waFh Hq45X+Ltt87tbSTE35V9Utd2WSTFElJc1+ZPCMFIVqWoRxlhUk1x2BQ/l/VFFYmkh7sk 7VgN9EqZwYM851ykECdaXF1qEwG9E0nMACbhsHtvoEMwo9MAtrxjBz3Xop36su+Bkh05 bXidnsdd9BGyU4cjclc/mCDUu3cG4S2Z8qu3lnFg5DFOu0IvyuHvt9vQtiKFfOy5LVYJ b+QQ== X-Gm-Message-State: AKaTC03TKqRj+AsKCoKeYKO+mR5aKlyYY6xZGrFbLQpvM8rAz6k/Xp0Q/ieis2laG9HHBDWJ X-Received: by 10.28.218.213 with SMTP id r204mr2347391wmg.69.1480676306173; Fri, 02 Dec 2016 02:58:26 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id pd2sm4925182wjb.31.2016.12.02.02.58.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2016 02:58:25 -0800 (PST) Date: Fri, 2 Dec 2016 10:58:23 +0000 From: Leif Lindholm To: Laszlo Ersek Cc: edk2-devel-01 , Ard Biesheuvel Message-ID: <20161202105823.GR27069@bivouac.eciton.net> References: <20161201175633.2538-1-lersek@redhat.com> <20161201175633.2538-2-lersek@redhat.com> MIME-Version: 1.0 In-Reply-To: <20161201175633.2538-2-lersek@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [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: , X-List-Received-Date: Fri, 02 Dec 2016 10:58:28 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 01, 2016 at 06:56:29PM +0100, Laszlo Ersek wrote: > 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 Looks sane to me. Reviewed-by: Leif Lindholm > --- > ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 31 ++++---------------- > 1 file changed, 6 insertions(+), 25 deletions(-) > > 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; > } > > -- > 2.9.2 > > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel