From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-x22a.google.com (mail-yb0-x22a.google.com [IPv6:2607:f8b0:4002:c09::22a]) (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 1D7A31A1E3A for ; Mon, 24 Oct 2016 01:00:05 -0700 (PDT) Received: by mail-yb0-x22a.google.com with SMTP id f97so64081477ybi.1 for ; Mon, 24 Oct 2016 01:00:05 -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=AJ7ZyM2L0aDVheR3BxdSHW/WVT+kV6FlY2R1EpL4V8k=; b=a7E2ZHKJWB0bw97Eq0EVpPEdYU1D0MGgHO7vLEypC5pnV1OB+vPG+dunO3d7TzjxuW EV9K3uDoqSZ4QQwDN7m5d/ajmtT6KGtbod2IKBi42Cg9YHQuf6OiLYGJaxJ/WmStDBK8 bWGiOLlJQsvAG11gv0eyUleKP4KXuvEWEDBe4= 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=AJ7ZyM2L0aDVheR3BxdSHW/WVT+kV6FlY2R1EpL4V8k=; b=mC+1KQkTU1OG8neO5mN1RRvfy0EePXQ16BNhC8yTbJNLM9vXmLE+RJtZIYKcvuHb05 MJxs5gSUZGSDI7rF5OyhWI2DhPnHLYQERSQVFA5HPLacZlra8LtJGDGshxPuUKyJTvwM eG5FUvfGZr19xWPNGbbbBOvLf+qeCQZVYhP3AZRsIwUE08JFbWtqBBdOrQ2qV+ugaxVQ WWJi65baXLANwd3VkQoiAFU6hqcD15CLVK3T8D0m572XoDWfTP6bxX8T2OMr4rPiu0ko MVv+zdorVARwdCQS6w6fG0/oMdHF57R+A4QV0ztr5AuLWSNnGLKq9BRUxyHUTgwaHEs6 +pag== X-Gm-Message-State: ABUngvcB3v7ckkLFbShb1//is2OdI1OADBn4bTeDJ5DbEhJ0CLckmRBQGF7M27BfTwS2IqQQG+RDvW0N032LHZPd X-Received: by 10.36.146.84 with SMTP id l81mr1183603itd.37.1477296004320; Mon, 24 Oct 2016 01:00:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Mon, 24 Oct 2016 01:00:03 -0700 (PDT) In-Reply-To: <20161021212737.15974-13-lersek@redhat.com> References: <20161021212737.15974-1-lersek@redhat.com> <20161021212737.15974-13-lersek@redhat.com> From: Ard Biesheuvel Date: Mon, 24 Oct 2016 09:00:03 +0100 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 Subject: Re: [PATCH 12/19] ArmVirtPkg/ArmVirtPL031FdtClientLib: 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:05 -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/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c > index 3c4e44caa2f4..82de7a51b32e 100644 > --- a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c > +++ b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c > @@ -34,6 +34,7 @@ ArmVirtPL031FdtClientLibConstructor ( > CONST UINT64 *Reg; > UINT32 RegSize; > UINT64 RegBase; > + RETURN_STATUS PcdStatus; > > Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL, > (VOID **)&FdtClient); > @@ -60,7 +61,8 @@ ArmVirtPL031FdtClientLibConstructor ( > RegBase = SwapBytes64 (Reg[0]); > ASSERT (RegBase < MAX_UINT32); > > - PcdSet32 (PcdPL031RtcBase, (UINT32)RegBase); > + PcdStatus = PcdSet32S (PcdPL031RtcBase, (UINT32)RegBase); > + ASSERT_RETURN_ERROR (PcdStatus); > > DEBUG ((EFI_D_INFO, "Found PL031 RTC @ 0x%Lx\n", RegBase)); > > -- > 2.9.2 > >