[PATCH 1/1] efi: capitalize enum efi_secureboot_mode labels

From: Heinrich Schuchardt
Date: Sun Feb 23 2020 - 03:36:53 EST


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

Signed-off-by: Heinrich Schuchardt <xypron.glpk@xxxxxx>
---
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