Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/1] efi: capitalize enum efi_secureboot_mode labels
@ 2020-02-23  8:34 Heinrich Schuchardt
  0 siblings, 0 replies; only message in thread
From: Heinrich Schuchardt @ 2020-02-23  8:34 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H . Peter Anvin,
	x86, Boris Ostrovsky, Juergen Gross, Stefano Stabellini,
	linux-kernel, xen-devel, linux-efi, Heinrich Schuchardt

According to the "Linux kernel coding style" labels in enums are
capitalized.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
The patch is applicable to the efi/next git branch.
---
 arch/x86/kernel/ima_arch.c                | 14 +++++++-------
 arch/x86/kernel/setup.c                   |  4 ++--
 arch/x86/xen/efi.c                        | 10 +++++-----
 drivers/firmware/efi/libstub/arm-stub.c   |  2 +-
 drivers/firmware/efi/libstub/secureboot.c | 10 +++++-----
 drivers/firmware/efi/libstub/x86-stub.c   |  2 +-
 include/linux/efi.h                       |  8 ++++----
 7 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/arch/x86/kernel/ima_arch.c b/arch/x86/kernel/ima_arch.c
index cb6ed616a543..4205baaae450 100644
--- a/arch/x86/kernel/ima_arch.c
+++ b/arch/x86/kernel/ima_arch.c
@@ -21,7 +21,7 @@ static enum efi_secureboot_mode get_sb_mode(void)

 	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) {
 		pr_info("ima: secureboot mode unknown, no efi\n");
-		return efi_secureboot_mode_unknown;
+		return EFI_SECUREBOOT_MODE_UNKNOWN;
 	}

 	/* Get variable contents into buffer */
@@ -29,12 +29,12 @@ static enum efi_secureboot_mode get_sb_mode(void)
 				  NULL, &size, &secboot);
 	if (status == EFI_NOT_FOUND) {
 		pr_info("ima: secureboot mode disabled\n");
-		return efi_secureboot_mode_disabled;
+		return EFI_SECUREBOOT_MODE_DISABLED;
 	}

 	if (status != EFI_SUCCESS) {
 		pr_info("ima: secureboot mode unknown\n");
-		return efi_secureboot_mode_unknown;
+		return EFI_SECUREBOOT_MODE_UNKNOWN;
 	}

 	size = sizeof(setupmode);
@@ -46,11 +46,11 @@ static enum efi_secureboot_mode get_sb_mode(void)

 	if (secboot == 0 || setupmode == 1) {
 		pr_info("ima: secureboot mode disabled\n");
-		return efi_secureboot_mode_disabled;
+		return EFI_SECUREBOOT_MODE_DISABLED;
 	}

 	pr_info("ima: secureboot mode enabled\n");
-	return efi_secureboot_mode_enabled;
+	return EFI_SECUREBOOT_MODE_ENABLED;
 }

 bool arch_ima_get_secureboot(void)
@@ -61,12 +61,12 @@ bool arch_ima_get_secureboot(void)
 	if (!initialized && efi_enabled(EFI_BOOT)) {
 		sb_mode = boot_params.secure_boot;

-		if (sb_mode == efi_secureboot_mode_unset)
+		if (sb_mode == EFI_SECUREBOOT_MODE_UNSET)
 			sb_mode = get_sb_mode();
 		initialized = true;
 	}

-	if (sb_mode == efi_secureboot_mode_enabled)
+	if (sb_mode == EFI_SECUREBOOT_MODE_ENABLED)
 		return true;
 	else
 		return false;
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index a74262c71484..76a7b66ef0e6 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1126,10 +1126,10 @@ void __init setup_arch(char **cmdline_p)

 	if (efi_enabled(EFI_BOOT)) {
 		switch (boot_params.secure_boot) {
-		case efi_secureboot_mode_disabled:
+		case EFI_SECUREBOOT_MODE_DISABLED:
 			pr_info("Secure boot disabled\n");
 			break;
-		case efi_secureboot_mode_enabled:
+		case EFI_SECUREBOOT_MODE_ENABLED:
 			pr_info("Secure boot enabled\n");
 			break;
 		default:
diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c
index 1abe455d926a..bb715e3c9474 100644
--- a/arch/x86/xen/efi.c
+++ b/arch/x86/xen/efi.c
@@ -110,7 +110,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
 				  NULL, &size, &secboot);

 	if (status == EFI_NOT_FOUND)
-		return efi_secureboot_mode_disabled;
+		return EFI_SECUREBOOT_MODE_DISABLED;

 	if (status != EFI_SUCCESS)
 		goto out_efi_err;
@@ -123,7 +123,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
 		goto out_efi_err;

 	if (secboot == 0 || setupmode == 1)
-		return efi_secureboot_mode_disabled;
+		return EFI_SECUREBOOT_MODE_DISABLED;

 	/* See if a user has put the shim into insecure mode. */
 	size = sizeof(moksbstate);
@@ -135,15 +135,15 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
 		goto secure_boot_enabled;

 	if (moksbstate == 1)
-		return efi_secureboot_mode_disabled;
+		return EFI_SECUREBOOT_MODE_DISABLED;

  secure_boot_enabled:
 	pr_info("UEFI Secure Boot is enabled.\n");
-	return efi_secureboot_mode_enabled;
+	return EFI_SECUREBOOT_MODE_ENABLED;

  out_efi_err:
 	pr_err("Could not determine UEFI Secure Boot status.\n");
-	return efi_secureboot_mode_unknown;
+	return EFI_SECUREBOOT_MODE_UNKNOWN;
 }

 void __init xen_efi_init(struct boot_params *boot_params)
diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c
index 13559c7e6643..87a3bdca1e0a 100644
--- a/drivers/firmware/efi/libstub/arm-stub.c
+++ b/drivers/firmware/efi/libstub/arm-stub.c
@@ -244,7 +244,7 @@ efi_status_t efi_entry(efi_handle_t handle, efi_system_table_t *sys_table_arg)
 	 * boot is enabled if we can't determine its state.
 	 */
 	if (!IS_ENABLED(CONFIG_EFI_ARMSTUB_DTB_LOADER) ||
-	     secure_boot != efi_secureboot_mode_disabled) {
+	     secure_boot != EFI_SECUREBOOT_MODE_DISABLED) {
 		if (strstr(cmdline_ptr, "dtb="))
 			pr_efi("Ignoring DTB from command line.\n");
 	} else {
diff --git a/drivers/firmware/efi/libstub/secureboot.c b/drivers/firmware/efi/libstub/secureboot.c
index a765378ad18c..7fdbf9a87c3d 100644
--- a/drivers/firmware/efi/libstub/secureboot.c
+++ b/drivers/firmware/efi/libstub/secureboot.c
@@ -38,7 +38,7 @@ enum efi_secureboot_mode efi_get_secureboot(void)
 	status = get_efi_var(efi_SecureBoot_name, &efi_variable_guid,
 			     NULL, &size, &secboot);
 	if (status == EFI_NOT_FOUND)
-		return efi_secureboot_mode_disabled;
+		return EFI_SECUREBOOT_MODE_DISABLED;
 	if (status != EFI_SUCCESS)
 		goto out_efi_err;

@@ -49,7 +49,7 @@ enum efi_secureboot_mode efi_get_secureboot(void)
 		goto out_efi_err;

 	if (secboot == 0 || setupmode == 1)
-		return efi_secureboot_mode_disabled;
+		return EFI_SECUREBOOT_MODE_DISABLED;

 	/*
 	 * See if a user has put the shim into insecure mode. If so, and if the
@@ -64,13 +64,13 @@ enum efi_secureboot_mode efi_get_secureboot(void)
 	if (status != EFI_SUCCESS)
 		goto secure_boot_enabled;
 	if (!(attr & EFI_VARIABLE_RUNTIME_ACCESS) && moksbstate == 1)
-		return efi_secureboot_mode_disabled;
+		return EFI_SECUREBOOT_MODE_DISABLED;

 secure_boot_enabled:
 	pr_efi("UEFI Secure Boot is enabled.\n");
-	return efi_secureboot_mode_enabled;
+	return EFI_SECUREBOOT_MODE_ENABLED;

 out_efi_err:
 	pr_efi_err("Could not determine UEFI Secure Boot status.\n");
-	return efi_secureboot_mode_unknown;
+	return EFI_SECUREBOOT_MODE_UNKNOWN;
 }
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index 9db98839d7b4..f06bc07a2f75 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -777,7 +777,7 @@ struct boot_params *efi_main(efi_handle_t handle,
 	 * If the boot loader gave us a value for secure_boot then we use that,
 	 * otherwise we ask the BIOS.
 	 */
-	if (boot_params->secure_boot == efi_secureboot_mode_unset)
+	if (boot_params->secure_boot == EFI_SECUREBOOT_MODE_UNSET)
 		boot_params->secure_boot = efi_get_secureboot();

 	/* Ask the firmware to clear memory on unclean shutdown */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 2ab33d5d6ca5..0d3cd3f61e73 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1081,10 +1081,10 @@ extern void efi_call_virt_check_flags(unsigned long flags, const char *call);
 extern unsigned long efi_call_virt_save_flags(void);

 enum efi_secureboot_mode {
-	efi_secureboot_mode_unset,
-	efi_secureboot_mode_unknown,
-	efi_secureboot_mode_disabled,
-	efi_secureboot_mode_enabled,
+	EFI_SECUREBOOT_MODE_UNSET,
+	EFI_SECUREBOOT_MODE_UNKNOWN,
+	EFI_SECUREBOOT_MODE_DISABLED,
+	EFI_SECUREBOOT_MODE_ENABLED,
 };
 enum efi_secureboot_mode efi_get_secureboot(void);

--
2.25.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-23  8:34 [PATCH 1/1] efi: capitalize enum efi_secureboot_mode labels Heinrich Schuchardt

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