From 01a8d3bb00d9e3b242fd11f86a0bb620cf6c1fae Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 23 Jun 2021 22:23:14 +0200 Subject: [PATCH] apps: simplify logical constraints EFI_ERROR(EFI_NOT_STARTED) is true. So we can simplify (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) to (rc == EFI_NOT_STARTED) Signed-off-by: Heinrich Schuchardt --- apps/bltgrid.c | 2 +- apps/lfbgrid.c | 2 +- apps/modelist.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/bltgrid.c b/apps/bltgrid.c index 2adde6a..56d62fa 100644 --- a/apps/bltgrid.c +++ b/apps/bltgrid.c @@ -46,7 +46,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) UINTN SizeOfInfo; rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo, &info); - if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) { + if (rc == EFI_NOT_STARTED) { Print(L"gop->QueryMode() returned %r\n", rc); Print(L"Trying to start GOP with SetMode().\n"); rc = uefi_call_wrapper(gop->SetMode, 2, gop, diff --git a/apps/lfbgrid.c b/apps/lfbgrid.c index 53a255a..0437107 100644 --- a/apps/lfbgrid.c +++ b/apps/lfbgrid.c @@ -70,7 +70,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) UINTN SizeOfInfo; rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo, &info); - if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) { + if (rc == EFI_NOT_STARTED) { Print(L"gop->QueryMode() returned %r\n", rc); Print(L"Trying to start GOP with SetMode().\n"); rc = uefi_call_wrapper(gop->SetMode, 2, gop, diff --git a/apps/modelist.c b/apps/modelist.c index 26892e1..13219b7 100644 --- a/apps/modelist.c +++ b/apps/modelist.c @@ -22,7 +22,7 @@ print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) UINTN SizeOfInfo; rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo, &info); - if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) { + if (rc == EFI_NOT_STARTED) { Print(L"gop->QueryMode() returned %r\n", rc); Print(L"Trying to start GOP with SetMode().\n"); rc = uefi_call_wrapper(gop->SetMode, 2, gop,