From patchwork Tue Nov 6 22:57:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 993971 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42qQ3B52GKz9s55 for ; Wed, 7 Nov 2018 09:59:18 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 4A137C22931; Tue, 6 Nov 2018 22:58:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EEBCDC22948; Tue, 6 Nov 2018 22:57:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 43DF0C22866; Tue, 6 Nov 2018 22:57:52 +0000 (UTC) Received: from mail-yw1-f74.google.com (mail-yw1-f74.google.com [209.85.161.74]) by lists.denx.de (Postfix) with ESMTPS id D147BC2282F for ; Tue, 6 Nov 2018 22:57:51 +0000 (UTC) Received: by mail-yw1-f74.google.com with SMTP id f66-v6so11335353ywa.0 for ; Tue, 06 Nov 2018 14:57:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=FYRuU2fJL6xW09HupNg1yf7EyJTnDZdo/9t44dwQGHk=; b=jcqnxGfNbmffRhhL+rgOMHToEBVb70Yd/wCNE9Hwy/gdQaudiNveIxwrIEYYHN1Nbg 5maQybBoB6PACiF96UWF+BFAmDqq9kR3v4B63mLPeO5R/Vh8ehlqkd5W0soPAC4QDeHH vQXV5bThj7wd8L3mp1bbXGGa/CgUPNZqhxIKU4an3/qVyET+SLF/Q3iASafE1qKCuCkw lIRmzyfPDpXJalWk8Nlg4xft9A3tcPRjYuk5Ka/pS2g3o8wgO/AOK1IpcjAjU63nf4oj MeIfa1pRjiGK2bunQ/mriF+FyoLdVpkWQGjG7TaMhQB1q0RM+rB3VgWccR3DIDHLjr8b n6EA== X-Gm-Message-State: AGRZ1gL3wCyVRwiOwCFEnUU4wbus2W+9hSEAJuYZJ6FBv+/zDjt7vI+L inkPpm3Xe9VYqk1cTKHwvr8Xywk= X-Google-Smtp-Source: AJdET5fQ9D049LdM1NMT5Q9oWoVIZRmbZe2Th5QIGOO71l2bEKOm9DD5TTygnyWZoI6/GxLvPl5EuDw= X-Received: by 2002:a81:7843:: with SMTP id t64-v6mr10133971ywc.3.1541545070328; Tue, 06 Nov 2018 14:57:50 -0800 (PST) Date: Tue, 6 Nov 2018 15:57:40 -0700 In-Reply-To: <20181106225744.139945-1-sjg@chromium.org> Message-Id: <20181106225744.139945-3-sjg@chromium.org> Mime-Version: 1.0 References: <20181106225744.139945-1-sjg@chromium.org> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-goog From: Simon Glass To: U-Boot Mailing List Cc: Alexander Graf Subject: [U-Boot] [PATCH v12 2/6] efi_loader: Drop setup_ok X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This value is stored in data which appears to be read-only with sandbox on my Ubuntu 18.04 machine. In any case it is not good practice to store run-time data in a build-time linker list. The value does not seem to be that useful, since tests that fail to setup are likely to fail to run also. Let's drop it for now. Signed-off-by: Simon Glass --- Changes in v12: None Changes in v11: - Add a new patch to drop setup_ok Changes in v9: None Changes in v7: None Changes in v5: None Changes in v4: None Changes in v3: None include/efi_selftest.h | 2 -- lib/efi_selftest/efi_selftest.c | 14 +++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/efi_selftest.h b/include/efi_selftest.h index 56beac305ec..49d3d6d0b47 100644 --- a/include/efi_selftest.h +++ b/include/efi_selftest.h @@ -129,7 +129,6 @@ u16 efi_st_get_key(void); * @setup: set up the unit test * @teardown: tear down the unit test * @execute: execute the unit test - * @setup_ok: setup was successful (set at runtime) * @on_request: test is only executed on request */ struct efi_unit_test { @@ -139,7 +138,6 @@ struct efi_unit_test { const struct efi_system_table *systable); int (*execute)(void); int (*teardown)(void); - int setup_ok; bool on_request; }; diff --git a/lib/efi_selftest/efi_selftest.c b/lib/efi_selftest/efi_selftest.c index dd338db687e..dfd11be2302 100644 --- a/lib/efi_selftest/efi_selftest.c +++ b/lib/efi_selftest/efi_selftest.c @@ -74,20 +74,20 @@ void efi_st_exit_boot_services(void) */ static int setup(struct efi_unit_test *test, unsigned int *failures) { - if (!test->setup) { - test->setup_ok = EFI_ST_SUCCESS; + int ret; + + if (!test->setup) return EFI_ST_SUCCESS; - } efi_st_printc(EFI_LIGHTBLUE, "\nSetting up '%s'\n", test->name); - test->setup_ok = test->setup(handle, systable); - if (test->setup_ok != EFI_ST_SUCCESS) { + ret = test->setup(handle, systable); + if (ret) { efi_st_error("Setting up '%s' failed\n", test->name); ++*failures; } else { efi_st_printc(EFI_LIGHTGREEN, "Setting up '%s' succeeded\n", test->name); } - return test->setup_ok; + return ret; } /* @@ -197,7 +197,7 @@ void efi_st_do_tests(const u16 *testname, unsigned int phase, continue; if (steps & EFI_ST_SETUP) setup(test, failures); - if (steps & EFI_ST_EXECUTE && test->setup_ok == EFI_ST_SUCCESS) + if (steps & EFI_ST_EXECUTE) execute(test, failures); if (steps & EFI_ST_TEARDOWN) teardown(test, failures);