From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (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 55A381A1E3A for ; Mon, 24 Oct 2016 00:59:35 -0700 (PDT) Received: by mail-yw0-x22b.google.com with SMTP id t192so176392447ywf.0 for ; Mon, 24 Oct 2016 00:59:35 -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=DovG7Q1Za92GmmJF/fWC4lSv19B1mg89TCAgUkO8Jzk=; b=XxLmRx1UI3nNJBjDuUNH5Swa1Q+TddhS9xrYUmduar868MJ8ig6ND8su49rxjeCtAL VX0sYRQl9Eqt9W9jPkSruWhLQptdAB7NdsJMG4eXbAnYyIW89072/YU1ZEXHwWqt9kgs 8vVLnkoKEku9JHNz183JCPySuBub9MPdKyGlo= 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=DovG7Q1Za92GmmJF/fWC4lSv19B1mg89TCAgUkO8Jzk=; b=C6LyMapv1dxgriEf+n9ZLZ6o2g8XLWYK0kR9q3iZS7BjAGcQ2aQmK6D/0ryRcHg0J6 D1CbyPdFXOEa3+XQo7rzwyCB3Ysr6rYNW4EKXo2Ey4eEMQmnFRglybc34XbYrcUrFa8O 2UW/M/iCx1IRy90ReVpxLmoNgkSxpOYnJGzWBc13DKZAkOMaJXRIehEkMGr4LwTtggFS fAx9QVjFW7Dg2dDppFPe0If3Br5LSzWGsKR0v4ZxZfX28xWOHSHQrDWNxzXBtKQtG8jv fk3o1gq8cE+0b6/B5Pf6qTOGJuRWk3ww8X59NoagNPftX0l7s/fM/7C8x7Mqz6vA7+Hi rC9A== X-Gm-Message-State: ABUngve6sl+yNwCyHTASLV7KdlybaSnbB5J5hFye65nd9JcfsbN5q0BgQ6gLs63TePH5sdi45ab2P4YQoh2B4+MW X-Received: by 10.107.28.148 with SMTP id c142mr11139075ioc.45.1477295974403; Mon, 24 Oct 2016 00:59:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Mon, 24 Oct 2016 00:59:33 -0700 (PDT) In-Reply-To: <20161021212737.15974-15-lersek@redhat.com> References: <20161021212737.15974-1-lersek@redhat.com> <20161021212737.15974-15-lersek@redhat.com> From: Ard Biesheuvel Date: Mon, 24 Oct 2016 08:59:33 +0100 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 Subject: Re: [PATCH 14/19] ArmVirtPkg/ArmVirtTimerFdtClientLib: 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:35 -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/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c > index 6e7461c6b2e7..c40838632352 100644 > --- a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c > +++ b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c > @@ -41,6 +41,7 @@ ArmVirtTimerFdtClientLibConstructor ( > CONST INTERRUPT_PROPERTY *InterruptProp; > UINT32 PropSize; > INT32 SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum; > + RETURN_STATUS PcdStatus; > > Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL, > (VOID **)&FdtClient); > @@ -78,10 +79,14 @@ ArmVirtTimerFdtClientLibConstructor ( > DEBUG ((EFI_D_INFO, "Found Timer interrupts %d, %d, %d, %d\n", > SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum)); > > - PcdSet32 (PcdArmArchTimerSecIntrNum, SecIntrNum); > - PcdSet32 (PcdArmArchTimerIntrNum, IntrNum); > - PcdSet32 (PcdArmArchTimerVirtIntrNum, VirtIntrNum); > - PcdSet32 (PcdArmArchTimerHypIntrNum, HypIntrNum); > + PcdStatus = PcdSet32S (PcdArmArchTimerSecIntrNum, SecIntrNum); > + ASSERT_RETURN_ERROR (PcdStatus); > + PcdStatus = PcdSet32S (PcdArmArchTimerIntrNum, IntrNum); > + ASSERT_RETURN_ERROR (PcdStatus); > + PcdStatus = PcdSet32S (PcdArmArchTimerVirtIntrNum, VirtIntrNum); > + ASSERT_RETURN_ERROR (PcdStatus); > + PcdStatus = PcdSet32S (PcdArmArchTimerHypIntrNum, HypIntrNum); > + ASSERT_RETURN_ERROR (PcdStatus); > > return EFI_SUCCESS; > } > -- > 2.9.2 > >