[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 2/5] Make all grub_efi_guid_t variables static
From: |
Robbie Harwood |
Subject: |
[PATCH v4 2/5] Make all grub_efi_guid_t variables static |
Date: |
Fri, 19 Aug 2022 16:54:41 -0400 |
This is believed to result in smaller code.
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
grub-core/commands/efi/efifwsetup.c | 4 ++--
grub-core/efiemu/i386/pc/cfgtables.c | 6 +++---
grub-core/kern/efi/fdt.c | 2 +-
grub-core/loader/efi/fdt.c | 2 +-
grub-core/term/efi/console.c | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/grub-core/commands/efi/efifwsetup.c
b/grub-core/commands/efi/efifwsetup.c
index b5b1f106c6..51bb2ace3b 100644
--- a/grub-core/commands/efi/efifwsetup.c
+++ b/grub-core/commands/efi/efifwsetup.c
@@ -36,7 +36,7 @@ grub_cmd_fwsetup (grub_command_t cmd __attribute__ ((unused)),
grub_efi_uint64_t os_indications = GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
grub_err_t status;
grub_size_t oi_size;
- grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
+ static grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
grub_efi_get_variable ("OsIndications", &global, &oi_size,
(void **) &old_os_indications);
@@ -63,7 +63,7 @@ efifwsetup_is_supported (void)
{
grub_efi_uint64_t *os_indications_supported = NULL;
grub_size_t oi_size = 0;
- grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
+ static grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
grub_boolean_t ret = 0;
grub_efi_get_variable ("OsIndicationsSupported", &global, &oi_size,
diff --git a/grub-core/efiemu/i386/pc/cfgtables.c
b/grub-core/efiemu/i386/pc/cfgtables.c
index e5fffb7d4a..1098f0b79f 100644
--- a/grub-core/efiemu/i386/pc/cfgtables.c
+++ b/grub-core/efiemu/i386/pc/cfgtables.c
@@ -29,9 +29,9 @@ grub_machine_efiemu_init_tables (void)
{
void *table;
grub_err_t err;
- grub_efi_guid_t smbios = GRUB_EFI_SMBIOS_TABLE_GUID;
- grub_efi_guid_t acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID;
- grub_efi_guid_t acpi = GRUB_EFI_ACPI_TABLE_GUID;
+ static grub_efi_guid_t smbios = GRUB_EFI_SMBIOS_TABLE_GUID;
+ static grub_efi_guid_t acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID;
+ static grub_efi_guid_t acpi = GRUB_EFI_ACPI_TABLE_GUID;
err = grub_efiemu_unregister_configuration_table (smbios);
if (err)
diff --git a/grub-core/kern/efi/fdt.c b/grub-core/kern/efi/fdt.c
index 30100c61c1..24f955289f 100644
--- a/grub-core/kern/efi/fdt.c
+++ b/grub-core/kern/efi/fdt.c
@@ -24,7 +24,7 @@ void *
grub_efi_get_firmware_fdt (void)
{
grub_efi_configuration_table_t *tables;
- grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
+ static grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
void *firmware_fdt = NULL;
unsigned int i;
diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c
index c86f283d75..80d7088747 100644
--- a/grub-core/loader/efi/fdt.c
+++ b/grub-core/loader/efi/fdt.c
@@ -86,7 +86,7 @@ grub_err_t
grub_fdt_install (void)
{
grub_efi_boot_services_t *b;
- grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
+ static grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
grub_efi_status_t status;
b = grub_efi_system_table->boot_services;
diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
index a3622e4fe5..532948a8e1 100644
--- a/grub-core/term/efi/console.c
+++ b/grub-core/term/efi/console.c
@@ -353,7 +353,7 @@ grub_console_getkeystatus (struct grub_term_input *term)
static grub_err_t
grub_efi_console_input_init (struct grub_term_input *term)
{
- grub_efi_guid_t text_input_ex_guid =
+ static grub_efi_guid_t text_input_ex_guid =
GRUB_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID;
if (grub_efi_is_finished)
--
2.35.1
- [PATCH 0/2] grub.texi: Document fwsetup and fix typo, Robbie Harwood, 2022/08/19
- [PATCH v4 3/5] templates: Check for EFI at runtime instead of config generation time, Robbie Harwood, 2022/08/19
- [PATCH v4 0/5] Improve logic to check for fwsetup support, Robbie Harwood, 2022/08/19
- [PATCH v4 5/5] Don't display a uefi-firmware entry if it's not supported, Robbie Harwood, 2022/08/19
- [PATCH 2/2] grub.texi: Fix mismatched brackets in halt command, Robbie Harwood, 2022/08/19
- [PATCH 1/1] grub.texi: Fix mismatched brackets in halt command, Robbie Harwood, 2022/08/19
- [PATCH 1/2] grub.text: Document fwsetup command, Robbie Harwood, 2022/08/19
- [PATCH v4 1/5] commands/efi/efifwsetup: Add missing grub_free()s, Robbie Harwood, 2022/08/19
- [PATCH v4 4/5] efi: Print an error if boot to firmware setup is not supported, Robbie Harwood, 2022/08/19
- [PATCH v4 2/5] Make all grub_efi_guid_t variables static,
Robbie Harwood <=