From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-x234.google.com (mail-yw0-x234.google.com [IPv6:2607:f8b0:4002:c05::234]) (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 85D531A1E3A for ; Mon, 24 Oct 2016 00:59:51 -0700 (PDT) Received: by mail-yw0-x234.google.com with SMTP id t192so176403466ywf.0 for ; Mon, 24 Oct 2016 00:59:51 -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=FiRYGwqHbO5n6NXP+kdzMM+Mauk2MchsRPJ5BsyFaIo=; b=FnUDcgn/QHFjNy1q4e9Qf4QRIUuODcVsHSROdtPq67JCyKLmVDe4Md0Bjbm/NxEZRa 7sI5Hmm/otg3+Mud3wYVNAuxABkbnHQIUMDAzRLKjC4iFvNWcL+k7TLKHLDym5RNUeU1 O2hyREXM/n5NJWYbXxTMajgnN6yW2Ro0PGU/Q= 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=FiRYGwqHbO5n6NXP+kdzMM+Mauk2MchsRPJ5BsyFaIo=; b=bhhhLnt+iM8/qXjHCbGU8/7ncJ1oIRczpzAj7xN88gsxOlAYmsptvmX7wM5Kdjruuf CYG6Nry90ZDVkt6VYeUXKIabyKj9ThhTQD3PsRncnSFAzhJXSxxSQvvpp0gNjVKaS6u1 6Q0vPsqHyrtP3f9mGkI0SPrSeDZdfPuMGsIZ8UakiPH8GUiRhPe9LuGxgtQ2rV+Wn5We O6ZIGB+W3gZRappdhuZeGj2IXVR5A2tMrrn/sYO/+gkn99YnpO8h/XUwnCXIZHZilpim LLyMsgayvtW8IjciBuHxqs4uPWTANnKbp08wGhEoI9fY9IBsu3Robe/86SmC4TAoM7le v1Vg== X-Gm-Message-State: ABUngvdqnMXWqcdTdpa0uQgbvcC01/XK8+NlmhC6kveNpHb8MK4g6kA81QllKEPqcQIHQUMRHdkh7lY7FyLZ0Z2P X-Received: by 10.107.25.11 with SMTP id 11mr11391809ioz.138.1477295990712; Mon, 24 Oct 2016 00:59:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Mon, 24 Oct 2016 00:59:50 -0700 (PDT) In-Reply-To: <20161021212737.15974-14-lersek@redhat.com> References: <20161021212737.15974-1-lersek@redhat.com> <20161021212737.15974-14-lersek@redhat.com> From: Ard Biesheuvel Date: Mon, 24 Oct 2016 08:59:50 +0100 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 Subject: Re: [PATCH 13/19] ArmVirtPkg/ArmVirtPlatformLib: 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:51 -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/ArmVirtPlatformLib/Virt.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c b/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c > index 7a0fc0e75e37..fcaf3c681a97 100644 > --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c > +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c > @@ -70,13 +70,14 @@ ArmPlatformInitializeSystemMemory ( > VOID > ) > { > - VOID *DeviceTreeBase; > - INT32 Node, Prev; > - UINT64 NewBase, CurBase; > - UINT64 NewSize, CurSize; > - CONST CHAR8 *Type; > - INT32 Len; > - CONST UINT64 *RegProp; > + VOID *DeviceTreeBase; > + INT32 Node, Prev; > + UINT64 NewBase, CurBase; > + UINT64 NewSize, CurSize; > + CONST CHAR8 *Type; > + INT32 Len; > + CONST UINT64 *RegProp; > + RETURN_STATUS PcdStatus; > > NewBase = 0; > NewSize = 0; > @@ -131,7 +132,8 @@ ArmPlatformInitializeSystemMemory ( > // Make sure the start of DRAM matches our expectation > // > ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) == NewBase); > - PcdSet64 (PcdSystemMemorySize, NewSize); > + PcdStatus = PcdSet64S (PcdSystemMemorySize, NewSize); > + ASSERT_RETURN_ERROR (PcdStatus); > > // > // We need to make sure that the machine we are running on has at least > -- > 2.9.2 > >