Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
From: Joe Perches <joe@perches.com>
To: Arvind Sankar <nivedita@alum.mit.edu>, linux-kernel@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
	linux-efi@vger.kernel.org, x86@kernel.org
Subject: [PATCH 1/2] efi/libstub: efi_info/efi_err message neatening
Date: Thu, 30 Apr 2020 12:12:41 -0700
Message-ID: <091e3fc3bdbc5f480af7d3b3ac096d174a4480d0.1588273612.git.joe@perches.com> (raw)
In-Reply-To: <20200430182843.2510180-1-nivedita@alum.mit.edu>

Use a standard style for these output logging messages.

Miscellanea:

o Use more common macro #defines with fmt, ##__VA_ARGS__
0 Remove trailing messages periods and odd ' uses
o Remove embedded function names and use %s, __func__

Signed-off-by: Joe Perches <joe@perches.com>
---

Perhaps these trivialities on top of this series?

 drivers/firmware/efi/libstub/arm32-stub.c | 10 +++++-----
 drivers/firmware/efi/libstub/efi-stub.c   |  2 +-
 drivers/firmware/efi/libstub/efistub.h    |  9 ++++++---
 drivers/firmware/efi/libstub/fdt.c        |  8 ++++----
 drivers/firmware/efi/libstub/pci.c        |  4 ++--
 drivers/firmware/efi/libstub/relocate.c   |  2 +-
 drivers/firmware/efi/libstub/secureboot.c |  4 ++--
 7 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/drivers/firmware/efi/libstub/arm32-stub.c b/drivers/firmware/efi/libstub/arm32-stub.c
index b038afe..5795781 100644
--- a/drivers/firmware/efi/libstub/arm32-stub.c
+++ b/drivers/firmware/efi/libstub/arm32-stub.c
@@ -120,7 +120,7 @@ static efi_status_t reserve_kernel_base(unsigned long dram_base,
 	 */
 	status = efi_get_memory_map(&map);
 	if (status != EFI_SUCCESS) {
-		efi_err("reserve_kernel_base(): Unable to retrieve memory map.\n");
+		efi_err("%s(): Unable to retrieve memory map\n", __func__);
 		return status;
 	}
 
@@ -162,7 +162,7 @@ static efi_status_t reserve_kernel_base(unsigned long dram_base,
 					     (end - start) / EFI_PAGE_SIZE,
 					     &start);
 			if (status != EFI_SUCCESS) {
-				efi_err("reserve_kernel_base(): alloc failed.\n");
+				efi_err("%s(): alloc failed\n", __func__);
 				goto out;
 			}
 			break;
@@ -219,7 +219,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
 
 	status = reserve_kernel_base(kernel_base, reserve_addr, reserve_size);
 	if (status != EFI_SUCCESS) {
-		efi_err("Unable to allocate memory for uncompressed kernel.\n");
+		efi_err("Unable to allocate memory for uncompressed kernel\n");
 		return status;
 	}
 
@@ -232,7 +232,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
 	status = efi_relocate_kernel(image_addr, *image_size, *image_size,
 				     kernel_base + MAX_UNCOMP_KERNEL_SIZE, 0, 0);
 	if (status != EFI_SUCCESS) {
-		efi_err("Failed to relocate kernel.\n");
+		efi_err("Failed to relocate kernel\n");
 		efi_free(*reserve_size, *reserve_addr);
 		*reserve_size = 0;
 		return status;
@@ -244,7 +244,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
 	 * address at which the zImage is loaded.
 	 */
 	if (*image_addr + *image_size > dram_base + ZIMAGE_OFFSET_LIMIT) {
-		efi_err("Failed to relocate kernel, no low memory available.\n");
+		efi_err("Failed to relocate kernel, no low memory available\n");
 		efi_free(*reserve_size, *reserve_addr);
 		*reserve_size = 0;
 		efi_free(*image_size, *image_addr);
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index c2484b..19b42b 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -251,7 +251,7 @@ efi_status_t efi_entry(efi_handle_t handle, efi_system_table_t *sys_table_arg)
 	if (!IS_ENABLED(CONFIG_EFI_ARMSTUB_DTB_LOADER) ||
 	     secure_boot != efi_secureboot_mode_disabled) {
 		if (strstr(cmdline_ptr, "dtb="))
-			efi_err("Ignoring DTB from command line.\n");
+			efi_err("Ignoring DTB from command line\n");
 	} else {
 		status = efi_load_dtb(image, &fdt_addr, &fdt_size);
 
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index 874233..369262 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -49,11 +49,14 @@ extern const efi_system_table_t *efi_system_table;
 #define efi_call_proto(inst, func, ...) inst->func(inst, ##__VA_ARGS__)
 #endif
 
-#define efi_info(msg)		do {			\
-	if (!efi_quiet) efi_printk("EFI stub: "msg);	\
+#define efi_info(fmt, ...)						\
+do {									\
+	if (!efi_quiet)							\
+		efi_printk("EFI stub: " fmt, ##__VA_ARGS__);		\
 } while (0)
 
-#define efi_err(msg) efi_printk("EFI stub: ERROR: "msg)
+#define efi_err(fmt, ...)						\
+	efi_printk("EFI stub: ERROR: " fmt, ##__VA_ARGS__)
 
 /* Helper macros for the usual case of using simple C variables: */
 #ifndef fdt_setprop_inplace_var
diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c
index 11ecf3c..7c7257 100644
--- a/drivers/firmware/efi/libstub/fdt.c
+++ b/drivers/firmware/efi/libstub/fdt.c
@@ -270,7 +270,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
 	 */
 	status = efi_get_memory_map(&map);
 	if (status != EFI_SUCCESS) {
-		efi_err("Unable to retrieve UEFI memory map.\n");
+		efi_err("Unable to retrieve UEFI memory map\n");
 		return status;
 	}
 
@@ -279,7 +279,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
 	map.map = &memory_map;
 	status = efi_allocate_pages(MAX_FDT_SIZE, new_fdt_addr, max_addr);
 	if (status != EFI_SUCCESS) {
-		efi_err("Unable to allocate memory for new device tree.\n");
+		efi_err("Unable to allocate memory for new device tree\n");
 		goto fail;
 	}
 
@@ -296,7 +296,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
 			    initrd_addr, initrd_size);
 
 	if (status != EFI_SUCCESS) {
-		efi_err("Unable to construct new device tree.\n");
+		efi_err("Unable to construct new device tree\n");
 		goto fail_free_new_fdt;
 	}
 
@@ -342,7 +342,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
 		return EFI_SUCCESS;
 	}
 
-	efi_err("Exit boot services failed.\n");
+	efi_err("Exit boot services failed\n");
 
 fail_free_new_fdt:
 	efi_free(MAX_FDT_SIZE, *new_fdt_addr);
diff --git a/drivers/firmware/efi/libstub/pci.c b/drivers/firmware/efi/libstub/pci.c
index 60af51b..111c44b 100644
--- a/drivers/firmware/efi/libstub/pci.c
+++ b/drivers/firmware/efi/libstub/pci.c
@@ -28,7 +28,7 @@ void efi_pci_disable_bridge_busmaster(void)
 
 	if (status != EFI_BUFFER_TOO_SMALL) {
 		if (status != EFI_SUCCESS && status != EFI_NOT_FOUND)
-			efi_err("Failed to locate PCI I/O handles'\n");
+			efi_err("Failed to locate PCI I/O handles\n");
 		return;
 	}
 
@@ -42,7 +42,7 @@ void efi_pci_disable_bridge_busmaster(void)
 	status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL, &pci_proto,
 			     NULL, &pci_handle_size, pci_handle);
 	if (status != EFI_SUCCESS) {
-		efi_err("Failed to locate PCI I/O handles'\n");
+		efi_err("Failed to locate PCI I/O handles\n");
 		goto free_handle;
 	}
 
diff --git a/drivers/firmware/efi/libstub/relocate.c b/drivers/firmware/efi/libstub/relocate.c
index 93c04d..62e2d6 100644
--- a/drivers/firmware/efi/libstub/relocate.c
+++ b/drivers/firmware/efi/libstub/relocate.c
@@ -157,7 +157,7 @@ efi_status_t efi_relocate_kernel(unsigned long *image_addr,
 					     min_addr);
 	}
 	if (status != EFI_SUCCESS) {
-		efi_err("Failed to allocate usable memory for kernel.\n");
+		efi_err("Failed to allocate usable memory for kernel\n");
 		return status;
 	}
 
diff --git a/drivers/firmware/efi/libstub/secureboot.c b/drivers/firmware/efi/libstub/secureboot.c
index 5efc524..796a31 100644
--- a/drivers/firmware/efi/libstub/secureboot.c
+++ b/drivers/firmware/efi/libstub/secureboot.c
@@ -67,10 +67,10 @@ enum efi_secureboot_mode efi_get_secureboot(void)
 		return efi_secureboot_mode_disabled;
 
 secure_boot_enabled:
-	efi_info("UEFI Secure Boot is enabled.\n");
+	efi_info("UEFI Secure Boot is enabled\n");
 	return efi_secureboot_mode_enabled;
 
 out_efi_err:
-	efi_err("Could not determine UEFI Secure Boot status.\n");
+	efi_err("Could not determine UEFI Secure Boot status\n");
 	return efi_secureboot_mode_unknown;
 }
-- 
2.26.0


  parent reply index

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 17:41 [PATCH 00/10] efi: some cleanups/refactoring for efi/next Arvind Sankar
2020-04-29 17:41 ` [PATCH 01/10] efi/x86: Use correct size for boot_params Arvind Sankar
2020-04-29 17:41 ` [PATCH 02/10] efi: Add a helper function to split 64-bit values Arvind Sankar
2020-04-29 23:51   ` kbuild test robot
2020-04-29 17:41 ` [PATCH 02/10] efi/libstub: " Arvind Sankar
2020-04-29 17:41 ` [PATCH 03/10] efi/x86: Use pr_efi_err for error messages Arvind Sankar
2020-04-29 18:47   ` Joe Perches
2020-04-29 18:49     ` Ard Biesheuvel
2020-04-29 18:57       ` Joe Perches
2020-04-29 18:59         ` Ard Biesheuvel
2020-04-29 19:47           ` Joe Perches
2020-04-29 19:48             ` Ard Biesheuvel
2020-04-29 21:43       ` Arvind Sankar
2020-04-29 21:45         ` Ard Biesheuvel
2020-04-29 21:51           ` Arvind Sankar
2020-04-29 21:53         ` Joe Perches
2020-04-29 21:55           ` Ard Biesheuvel
2020-04-29 22:20             ` Arvind Sankar
2020-04-30 15:14               ` Ard Biesheuvel
2020-04-29 17:41 ` [PATCH 04/10] efi/gop: " Arvind Sankar
2020-04-29 17:41 ` [PATCH 05/10] efi/tpm: " Arvind Sankar
2020-04-29 17:41 ` [PATCH 06/10] efi/x86: Move command-line initrd loading to efi_main Arvind Sankar
2020-04-29 17:41 ` [PATCH 07/10] efi/libstub: Unify initrd loading across architectures Arvind Sankar
2020-04-29 17:41 ` [PATCH 08/10] efi/x86: Drop soft_limit for x86 initrd loading Arvind Sankar
2020-04-29 19:05   ` Ard Biesheuvel
2020-04-29 21:33     ` Arvind Sankar
2020-04-29 17:41 ` [PATCH 09/10] efi/x86: Support builtin command line Arvind Sankar
2020-04-29 19:07   ` Ard Biesheuvel
2020-04-29 21:39     ` Arvind Sankar
2020-04-29 21:40       ` Ard Biesheuvel
2020-04-29 21:48         ` Arvind Sankar
2020-04-29 21:51           ` Ard Biesheuvel
2020-04-29 17:41 ` [PATCH 10/10] efi/libstub: Check return value of efi_parse_options Arvind Sankar
2020-04-30  4:31   ` kbuild test robot
2020-04-30 18:28 ` [PATCH v2 00/11] efi: some cleanups/refactoring for efi/next Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 01/11] efi/x86: Use correct size for boot_params Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 02/11] efi/libstub: Add a helper function to split 64-bit values Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 03/11] efi/libstub: Move pr_efi/pr_efi_err into efi namespace Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 04/11] efi/x86: Use efi_err for error messages Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 05/11] efi/gop: " Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 06/11] efi/tpm: " Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 07/11] efi/libstub: Upgrade ignored dtb= argument message to error Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 08/11] efi/x86: Move command-line initrd loading to efi_main Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 09/11] efi/libstub: Unify initrd loading across architectures Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 10/11] efi/x86: Support builtin command line Arvind Sankar
2020-04-30 18:28   ` [PATCH v2 11/11] efi/libstub: Check return value of efi_parse_options Arvind Sankar
2020-04-30 19:12   ` Joe Perches [this message]
2020-04-30 19:12     ` [PATCH 2/2] efi/libstub: Correct comment typos Joe Perches
2020-04-30 19:30       ` Ard Biesheuvel
2020-05-04 18:29         ` [trivial PATCH] efi/libstub: Reduce efi_printk object size Joe Perches
2020-05-05  7:50           ` Ard Biesheuvel
2020-05-05  8:01             ` Joe Perches
2020-04-30 19:29     ` [PATCH 1/2] efi/libstub: efi_info/efi_err message neatening Ard Biesheuvel
2020-04-30 19:38       ` Joe Perches
2020-04-30 20:40       ` Arvind Sankar
2020-04-30 20:42         ` Ard Biesheuvel
2020-05-04  8:17   ` [PATCH v2 00/11] efi: some cleanups/refactoring for efi/next Ard Biesheuvel

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=091e3fc3bdbc5f480af7d3b3ac096d174a4480d0.1588273612.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nivedita@alum.mit.edu \
    --cc=x86@kernel.org \
    /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

Linux-EFI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-efi/0 linux-efi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-efi linux-efi/ https://lore.kernel.org/linux-efi \
		linux-efi@vger.kernel.org
	public-inbox-index linux-efi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-efi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git