From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::243; helo=mail-it0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (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 E1E912219BCAF for ; Sat, 23 Dec 2017 05:17:47 -0800 (PST) Received: by mail-it0-x243.google.com with SMTP id 68so17320013ite.4 for ; Sat, 23 Dec 2017 05:22:39 -0800 (PST) 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=AY8zWr9rCw6mKgFlQrQU6xUM12ZjyJcK9fwfElVY5jk=; b=KCNgY0phmmGo/PVqbFbPp9gmUzIB0dqSxNApTY6Jb1zbc0cSLZXAKa6IN2GoGOQ/BY 0dS76yb2CcjYDjg2cGraHAZwCkqNx/rwvUFv0QhytpdPwd4hfObgdyVsWUH0B07YpGWc DDx0WbEfd7NsJEgsmKhXwnlmhJXkdgR+vhjlc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AY8zWr9rCw6mKgFlQrQU6xUM12ZjyJcK9fwfElVY5jk=; b=CQaZUygV1XYyo4bBiCOiazxwkIB6wleYoOIqSfEvjG0HY1tKXfrHouynWBjPjibGE1 h0vihGhY3vLalVF5iqf542bV/bgakoaMvTLmwMzjOqg9YyEJu/0V7f0enBfiQzlZqAFF PfmftjTLg+JMN3VDdUisPGieQ+TrC6X9dsc8AhUfgbm0+ahuD/EL0CyMbwtZXN1C3Rmw QeFFEZvsLZ1eDQPFR2YyvdYLd1c2H0LO+rotVSQhgevYSgylPUYfan7PQU1ajy1kp2iN UpCuwc8RLT4tVjrD8BV4ItAA1IS3BQe3koFxrIKNODxJlZrUgvxXcIh1HvwQHCxGIo// 5Y1g== X-Gm-Message-State: AKGB3mIi4A8onuawEaPP13jHrMVbMJ9jBIReF2Su4Flk5sFb4ttlsY0w wKDY0y8F/IHvBJjm9CQ6dWvebCSbf+zGtTv9UBkIsA== X-Google-Smtp-Source: ACJfBoutKOQZnFLUEblYQW3QbUc8wL6IYUBClu+VtFUppKNrxMoRQMeXOKLnXZHrDXdxqfz5eCIEC3y/zfACf9MJyww= X-Received: by 10.36.55.138 with SMTP id r132mr21941080itr.34.1514035358122; Sat, 23 Dec 2017 05:22:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.52.14 with HTTP; Sat, 23 Dec 2017 05:22:37 -0800 (PST) In-Reply-To: <20171222183418.8616-5-evan.lloyd@arm.com> References: <20171222183418.8616-1-evan.lloyd@arm.com> <20171222183418.8616-5-evan.lloyd@arm.com> From: Ard Biesheuvel Date: Sat, 23 Dec 2017 13:22:37 +0000 Message-ID: To: Evan Lloyd Cc: "edk2-devel@lists.01.org" , <"ard.biesheuvel@linaro.org"@arm.com>, <"leif.lindholm@linaro.org"@arm.com>, <"Matteo.Carlini@arm.com"@arm.com>, <"nd@arm.com"@arm.com> Subject: Re: [PATCH v2 04/13] ArmPlatformPkg: HDLCD and PL111: Update debug ASSERTS X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 13:17:48 -0000 Content-Type: text/plain; charset="UTF-8" On 22 December 2017 at 18:34, wrote: > From: Girish Pathak > > This change moves some ASSERTs in error handling code > to improve efficiency in DEBUG build. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Girish Pathak > Signed-off-by: Evan Lloyd > --- > ArmPlatformPkg/Library/HdLcd/HdLcd.c | 11 ++++------- > ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c | 8 ++++---- > 2 files changed, 8 insertions(+), 11 deletions(-) > > diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.c b/ArmPlatformPkg/Library/HdLcd/HdLcd.c > index a1eeabfefe7d32e6182371e5b131ac5df0dd4dd7..d71b6020dc0c4b91e74d16e96b06a60601b9628a 100644 > --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.c > +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.c > @@ -122,15 +122,15 @@ LcdSetMode ( > &VBackPorch, > &VFrontPorch > ); > - ASSERT_EFI_ERROR (Status); > if (EFI_ERROR (Status)) { > - return EFI_DEVICE_ERROR; > + ASSERT (FALSE); Please don't replace ASSERT_EFI_ERROR with ASSERT(FALSE). The former will print the value of Status in the DEBUG output, while that latter only prints '0 != 1' which is not very helpful in diagnosing the error condition. > + return Status; > } > > Status = LcdPlatformGetBpp (ModeNumber, &LcdBpp); > - ASSERT_EFI_ERROR (Status); > if (EFI_ERROR (Status)) { > - return EFI_DEVICE_ERROR; > + ASSERT (FALSE); > + return Status; > } > > BytesPerPixel = GetBytesPerPixel (LcdBpp); > @@ -174,9 +174,6 @@ LcdShutdown (VOID) > > @retval EFI_SUCCESS Returns success if platform implements a HDLCD > controller. > - > - @retval EFI_NOT_FOUND HDLCD display controller not found on the > - platform > **/ > EFI_STATUS > LcdIdentify (VOID) > diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c > index 53b402f711ff10d70feba38671171c027a98b4ba..267c972bf795997f1df88b82acbaea5f75a7a00e 100644 > --- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c > +++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c > @@ -105,15 +105,15 @@ LcdSetMode ( > &VBackPorch, > &VFrontPorch > ); > - ASSERT_EFI_ERROR (Status); > if (EFI_ERROR (Status)) { > - return EFI_DEVICE_ERROR; > + ASSERT (FALSE); > + return Status; > } > > Status = LcdPlatformGetBpp (ModeNumber, &LcdBpp); > - ASSERT_EFI_ERROR (Status); > if (EFI_ERROR (Status)) { > - return EFI_DEVICE_ERROR; > + ASSERT (FALSE); > + return Status; > } > > // Disable the CLCD_LcdEn bit > -- > Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") >