From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-x232.google.com (mail-yb0-x232.google.com [IPv6:2607:f8b0:4002:c09::232]) (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 CDEA51A1E3A for ; Mon, 24 Oct 2016 01:00:24 -0700 (PDT) Received: by mail-yb0-x232.google.com with SMTP id f97so64094764ybi.1 for ; Mon, 24 Oct 2016 01:00:24 -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=TyydWXZNDL9NluAUIdH5SDDgjWlYB9NICOm/+Dz5nQE=; b=Dcb8u18WAxjcchc4KpKYpQHwSlJmGzTOv6rymQgtB6rcQqL9fuF7mSd4FWMRGeQVT8 UhDEHguVljWIZD3GOLXu2CE5+3+SB7scjNVsK4bd0gWzgTuJPpZrlF6bqlDUGDb5MHrl k9ZRCDdALGEPrT5BNA3b3T9POVsUOSRwjCdwI= 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=TyydWXZNDL9NluAUIdH5SDDgjWlYB9NICOm/+Dz5nQE=; b=G1uBpMmpBJum/BN8i5ud7QBrKqu7Jdet52WMpRCmpENukmQBVQkwnaIVibS8IAGUSu Z5dlYYOQW3VB8zK3yvRVZEtGMVJbqLE/eIfDVxLcHYzDRdaGxgmAt44aPacFgsEaJ+Nz /593nufMsG30Drp0sAHUZ2dKu679V8rphysAuXavP+iJ1Hg6jeC6Fi2hPadnXGCrJ3Wh 38/rZmc9M8AIp0PoQogcZzccTF3ZDSg0UocIlejeMHNaelTVF9HS0tv1PRp29u/NFXGB tABr7dF+EvqfigNMSiuVBpTdrtqyuc+PxAHBRTl2fhTUdr/2FVLPcyPH0XHF999McQ8g qF2w== X-Gm-Message-State: ABUngveSxXaP0mmSvnQqEjTqBSDSse3chfzr+wghjqurbf11HKoN3CSo5poHjn/U52h2Hz2zJ2fdzl7w8P6Gz0m1 X-Received: by 10.36.80.67 with SMTP id m64mr1155698itb.59.1477296024020; Mon, 24 Oct 2016 01:00:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Mon, 24 Oct 2016 01:00:23 -0700 (PDT) In-Reply-To: <20161021212737.15974-12-lersek@redhat.com> References: <20161021212737.15974-1-lersek@redhat.com> <20161021212737.15974-12-lersek@redhat.com> From: Ard Biesheuvel Date: Mon, 24 Oct 2016 09:00:23 +0100 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 Subject: Re: [PATCH 11/19] ArmVirtPkg/ArmVirtGicArchLib: 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 08:00:25 -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/ArmVirtGicArchLib/ArmVirtGicArchLib.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c > index 648806126e78..dc1f5155f1fc 100644 > --- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c > +++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c > @@ -41,6 +41,7 @@ ArmVirtGicArchLibConstructor ( > UINTN GicRevision; > EFI_STATUS Status; > UINT64 DistBase, CpuBase, RedistBase; > + RETURN_STATUS PcdStatus; > > Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL, > (VOID **)&FdtClient); > @@ -85,8 +86,10 @@ ArmVirtGicArchLibConstructor ( > RedistBase = SwapBytes64 (Reg[2]); > ASSERT (RedistBase < MAX_UINTN); > > - PcdSet64 (PcdGicDistributorBase, DistBase); > - PcdSet64 (PcdGicRedistributorsBase, RedistBase); > + PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase); > + ASSERT_RETURN_ERROR (PcdStatus); > + PcdStatus = PcdSet64S (PcdGicRedistributorsBase, RedistBase); > + ASSERT_RETURN_ERROR (PcdStatus); > > DEBUG ((EFI_D_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n", > DistBase, RedistBase)); > @@ -120,8 +123,10 @@ ArmVirtGicArchLibConstructor ( > ASSERT (DistBase < MAX_UINTN); > ASSERT (CpuBase < MAX_UINTN); > > - PcdSet64 (PcdGicDistributorBase, DistBase); > - PcdSet64 (PcdGicInterruptInterfaceBase, CpuBase); > + PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase); > + ASSERT_RETURN_ERROR (PcdStatus); > + PcdStatus = PcdSet64S (PcdGicInterruptInterfaceBase, CpuBase); > + ASSERT_RETURN_ERROR (PcdStatus); > > DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase)); > > -- > 2.9.2 > >