All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v11 6/6] efi: Rename bootefi_test_finish() to bootefi_run_finish()
Date: Mon, 15 Oct 2018 08:17:50 -0600	[thread overview]
Message-ID: <20181015141750.56480-7-sjg@chromium.org> (raw)
In-Reply-To: <20181015141750.56480-1-sjg@chromium.org>

This function can be used from do_bootefi_exec() so that we use mostly the
same code for a normal EFI application and an EFI test.

Rename the function and use it in both places.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v11:
- Drop patches previously applied

Changes in v9: None
Changes in v7:
- Drop patch "efi: Init the 'rows' and 'cols' variables"
- Drop patches previous applied

Changes in v5:
- Rebase to master

Changes in v4:
- Rebase to master

Changes in v3:
- Add new patch to rename bootefi_test_finish() to bootefi_run_finish()

 cmd/bootefi.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 6a9a610a65c..d5a03ee7f6d 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -344,6 +344,20 @@ static efi_status_t bootefi_run_prepare(const char *load_options_path,
 	return 0;
 }
 
+/**
+ * bootefi_run_finish() - finish up after running an EFI test
+ *
+ * @image: Pointer to a struct which holds the loaded image info
+ * @obj: Pointer to a struct which holds the loaded image object
+ */
+static void bootefi_run_finish(struct efi_loaded_image *image,
+			       struct efi_loaded_image_obj *obj)
+{
+	efi_restore_gd();
+	free(image->load_options);
+	efi_delete_handle(&obj->parent);
+}
+
 /**
  * do_bootefi_exec() - execute EFI binary
  *
@@ -461,8 +475,7 @@ static efi_status_t do_bootefi_exec(void *efi,
 
 exit:
 	/* image has returned, loaded-image obj goes *poof*: */
-	if (obj)
-		efi_delete_handle(&obj->parent);
+	bootefi_run_finish(image, obj);
 	if (mem_handle)
 		efi_delete_handle(mem_handle);
 
@@ -500,20 +513,6 @@ static efi_status_t bootefi_test_prepare(struct efi_loaded_image **imagep,
 	return bootefi_run_prepare(load_options_path, bootefi_device_path,
 				   bootefi_image_path, imagep, objp);
 }
-
-/**
- * bootefi_test_finish() - finish up after running an EFI test
- *
- * @image: Pointer to a struct which holds the loaded image info
- * @obj: Pointer to a struct which holds the loaded image object
- */
-static void bootefi_test_finish(struct efi_loaded_image *image,
-				struct efi_loaded_image_obj *obj)
-{
-	efi_restore_gd();
-	free(image->load_options);
-	efi_delete_handle(&obj->parent);
-}
 #endif /* CONFIG_CMD_BOOTEFI_SELFTEST */
 
 static int do_bootefi_bootmgr_exec(void)
@@ -604,7 +603,7 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 		/* Execute the test */
 		r = efi_selftest(obj, &systab);
-		bootefi_test_finish(image, obj);
+		bootefi_run_finish(image, obj);
 		return r != EFI_SUCCESS;
 	} else
 #endif
-- 
2.19.1.331.ge82ca0e54c-goog

      parent reply	other threads:[~2018-10-15 14:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 14:17 [U-Boot] [PATCH v11 0/6] efi_loader: Code refactoring and improvement Simon Glass
2018-10-15 14:17 ` [U-Boot] [PATCH v11 1/6] sandbox: Put CPUs under a cpu-bus node Simon Glass
2018-10-15 17:05   ` Heinrich Schuchardt
2018-10-15 14:17 ` [U-Boot] [PATCH v11 2/6] efi_loader: Drop setup_ok Simon Glass
2018-10-15 17:16   ` Heinrich Schuchardt
2018-10-19  3:25     ` Simon Glass
2018-10-19  5:53       ` Heinrich Schuchardt
2018-10-15 14:17 ` [U-Boot] [PATCH v11 3/6] sandbox: smbios: Update to support sandbox Simon Glass
2018-10-16 12:55   ` Alexander Graf
2018-10-19  3:25     ` Simon Glass
2018-10-19  7:27       ` Alexander Graf
2018-10-22 17:49         ` Simon Glass
2018-10-22 18:32           ` Alexander Graf
2018-11-04 18:39             ` Simon Glass
2018-10-15 14:17 ` [U-Boot] [PATCH v11 4/6] efi: Split out test init/uninit into functions Simon Glass
2018-10-15 17:34   ` Heinrich Schuchardt
2018-11-04 18:46     ` Simon Glass
2018-10-15 14:17 ` [U-Boot] [PATCH v11 5/6] efi: Create a function to set up for running EFI code Simon Glass
2018-10-15 14:17 ` Simon Glass [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181015141750.56480-7-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.