From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-x230.google.com (mail-yb0-x230.google.com [IPv6:2607:f8b0:4002:c09::230]) (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 4698A1A1E3A for ; Mon, 24 Oct 2016 00:59:16 -0700 (PDT) Received: by mail-yb0-x230.google.com with SMTP id g68so69123381ybi.0 for ; Mon, 24 Oct 2016 00:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NvmHF/UWrcUq2YgCJ828Li1ZGJ4a/pSblF+wlPO4aYE=; b=EQCNjmGqctiw52w8PttZSy1NcB8tpgh/f+3j2jYpd4DClJ6/mao5dMojH2UZKRyOT1 ipbiDsz4vxvDQgVpIp+gCDdw5djV2GJ6do9gVtGOme3IPfNJOLM0s/gmbgmpmZytjo/8 F9ScAvIL+5vn8h6F+qLz52J+G7eYvwsRvEqK0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NvmHF/UWrcUq2YgCJ828Li1ZGJ4a/pSblF+wlPO4aYE=; b=dTOOHMzlP2NFZlP9KPf4JKfpS8/pIF6HB1nFw66Kbn00ewn69HSLMgS5lWjDdXW9sN Y32WNWM7KY8fmljhSgEXcP7nhFuZnNh8kXR1tR8WFCdDxpdStN1k7Oj+aIVZnpnZj2hw DtRwei2adr9Z+SdrBttRz1s68X021h4CE7+JLPsvgnXdR6g+DScHHkJ1/NJpbS/XPX/R MS0B+gdeYPljBsZtgtpN/OqacUk5tIElXb/BPmL65ocfJcRxvNEDg2A1sJ0nHZKiCA2I 8lQsFDBfcCBLK8vbnluOUMS1lthe3RAiY3RSwPuy3JsSbWVS3g+qlXPCLkWq8urzl7jI ll6Q== X-Gm-Message-State: ABUngvdOoQjMAeDhIc3HdiHGcdV6XggdBkmVJdbXkfDuMX8xAV4NvJu76sEhluvUScuDOlXiLsUhYt6wDLFadj1/ X-Received: by 10.36.66.142 with SMTP id i136mr1151366itb.63.1477295955439; Mon, 24 Oct 2016 00:59:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Mon, 24 Oct 2016 00:59:15 -0700 (PDT) In-Reply-To: <20161021212737.15974-16-lersek@redhat.com> References: <20161021212737.15974-1-lersek@redhat.com> <20161021212737.15974-16-lersek@redhat.com> From: Ard Biesheuvel Date: Mon, 24 Oct 2016 08:59:15 +0100 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 Subject: Re: [PATCH 15/19] ArmVirtPkg/FdtPciPcdProducerLib: eliminate unchecked PcdSetXX() calls 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: Mon, 24 Oct 2016 07:59:16 -0000 Content-Type: text/plain; charset=UTF-8 On 21 October 2016 at 22:27, Laszlo Ersek wrote: > These are deprecated / disabled under the > DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. > > Introduce a variable called PcdStatus, and use it to assert the success of > these operations (there is no reason for them to fail here). > > Cc: Ard Biesheuvel > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=165 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel > --- > ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c > index ea27cda7b77c..072f54ef7d9e 100644 > --- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c > +++ b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c > @@ -98,6 +98,7 @@ FdtPciPcdProducerLibConstructor ( > INT32 Node; > RETURN_STATUS RetStatus; > UINT64 IoTranslation; > + RETURN_STATUS PcdStatus; > > PciExpressBaseAddress = PcdGet64 (PcdPciExpressBaseAddress); > if (PciExpressBaseAddress != MAX_UINT64) { > @@ -126,12 +127,14 @@ FdtPciPcdProducerLibConstructor ( > if (!EFI_ERROR (Status) && RegSize == 2 * sizeof (UINT64)) { > PciExpressBaseAddress = SwapBytes64 (*Reg); > > - PcdSetBool (PcdPciDisableBusEnumeration, FALSE); > + PcdStatus = PcdSetBoolS (PcdPciDisableBusEnumeration, FALSE); > + ASSERT_RETURN_ERROR (PcdStatus); > > IoTranslation = 0; > RetStatus = GetPciIoTranslation (FdtClient, Node, &IoTranslation); > if (!RETURN_ERROR (RetStatus)) { > - PcdSet64 (PcdPciIoTranslation, IoTranslation); > + PcdStatus = PcdSet64S (PcdPciIoTranslation, IoTranslation); > + ASSERT_RETURN_ERROR (PcdStatus); > } else { > // > // Support for I/O BARs is not mandatory, and so it does not make sense > @@ -145,7 +148,8 @@ FdtPciPcdProducerLibConstructor ( > } > } > > - PcdSet64 (PcdPciExpressBaseAddress, PciExpressBaseAddress); > + PcdStatus = PcdSet64S (PcdPciExpressBaseAddress, PciExpressBaseAddress); > + ASSERT_RETURN_ERROR (PcdStatus); > > return RETURN_SUCCESS; > } > -- > 2.9.2 > >