[PATCH 1/5] efi: selftest: Make record static

record is only referenced in efi_selftest_exitbootservices.c
Signed-off-by: Bin Meng bmeng@tinylab.org ---
lib/efi_selftest/efi_selftest_exitbootservices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_selftest/efi_selftest_exitbootservices.c b/lib/efi_selftest/efi_selftest_exitbootservices.c index 11b43fdd90..b090ce74d2 100644 --- a/lib/efi_selftest/efi_selftest_exitbootservices.c +++ b/lib/efi_selftest/efi_selftest_exitbootservices.c @@ -27,7 +27,7 @@ struct notification_context {
static struct efi_boot_services *boottime; static struct efi_event *efi_st_event_notify; -struct notification_record record; +static struct notification_record record;
struct notification_context context_before = { .record = &record,

load_file() and load_file2() are only referenced in efi_selftest_load_file.c
Signed-off-by: Bin Meng bmeng@tinylab.org ---
lib/efi_selftest/efi_selftest_load_file.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/efi_selftest/efi_selftest_load_file.c b/lib/efi_selftest/efi_selftest_load_file.c index 8784a76172..14df761172 100644 --- a/lib/efi_selftest/efi_selftest_load_file.c +++ b/lib/efi_selftest/efi_selftest_load_file.c @@ -206,11 +206,11 @@ static efi_status_t decompress(u8 **image) * @buffer_size: (required) buffer size * @buffer: buffer to which the file is to be loaded */ -efi_status_t EFIAPI load_file(struct efi_load_file_protocol *this, - struct efi_device_path *file_path, - bool boot_policy, - efi_uintn_t *buffer_size, - void *buffer) +static efi_status_t EFIAPI load_file(struct efi_load_file_protocol *this, + struct efi_device_path *file_path, + bool boot_policy, + efi_uintn_t *buffer_size, + void *buffer) { ++load_file_call_count; if (memcmp(file_path, dp_lf_file_remainder, @@ -243,11 +243,11 @@ efi_status_t EFIAPI load_file(struct efi_load_file_protocol *this, * @buffer_size: (required) buffer size * @buffer: buffer to which the file is to be loaded */ -efi_status_t EFIAPI load_file2(struct efi_load_file_protocol *this, - struct efi_device_path *file_path, - bool boot_policy, - efi_uintn_t *buffer_size, - void *buffer) +static efi_status_t EFIAPI load_file2(struct efi_load_file_protocol *this, + struct efi_device_path *file_path, + bool boot_policy, + efi_uintn_t *buffer_size, + void *buffer) { ++load_file2_call_count; if (memcmp(file_path, dp_lf2_file_remainder,

On Wed, Apr 05, 2023 at 08:15:16PM +0800, Bin Meng wrote:
load_file() and load_file2() are only referenced in efi_selftest_load_file.c
Signed-off-by: Bin Meng bmeng@tinylab.org
lib/efi_selftest/efi_selftest_load_file.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/efi_selftest/efi_selftest_load_file.c b/lib/efi_selftest/efi_selftest_load_file.c index 8784a76172..14df761172 100644 --- a/lib/efi_selftest/efi_selftest_load_file.c +++ b/lib/efi_selftest/efi_selftest_load_file.c @@ -206,11 +206,11 @@ static efi_status_t decompress(u8 **image)
- @buffer_size: (required) buffer size
- @buffer: buffer to which the file is to be loaded
*/ -efi_status_t EFIAPI load_file(struct efi_load_file_protocol *this,
struct efi_device_path *file_path,
bool boot_policy,
efi_uintn_t *buffer_size,
void *buffer)
+static efi_status_t EFIAPI load_file(struct efi_load_file_protocol *this,
struct efi_device_path *file_path,
bool boot_policy,
efi_uintn_t *buffer_size,
void *buffer)
{ ++load_file_call_count; if (memcmp(file_path, dp_lf_file_remainder, @@ -243,11 +243,11 @@ efi_status_t EFIAPI load_file(struct efi_load_file_protocol *this,
- @buffer_size: (required) buffer size
- @buffer: buffer to which the file is to be loaded
*/ -efi_status_t EFIAPI load_file2(struct efi_load_file_protocol *this,
struct efi_device_path *file_path,
bool boot_policy,
efi_uintn_t *buffer_size,
void *buffer)
+static efi_status_t EFIAPI load_file2(struct efi_load_file_protocol *this,
struct efi_device_path *file_path,
bool boot_policy,
efi_uintn_t *buffer_size,
void *buffer)
{ ++load_file2_call_count; if (memcmp(file_path, dp_lf2_file_remainder, -- 2.34.1
Reviewed-by: Ilias Apalodimas ilias.apalodimas@linaro.org

efi_event_queue and efi_register_notify_events are only referenced in efi_boottime.c
Signed-off-by: Bin Meng bmeng@tinylab.org ---
include/efi_loader.h | 3 --- lib/efi_loader/efi_boottime.c | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/efi_loader.h b/include/efi_loader.h index 1542b4b625..0a2083c39a 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -509,9 +509,6 @@ struct efi_register_notify_event { struct list_head handles; };
-/* List of all events registered by RegisterProtocolNotify() */ -extern struct list_head efi_register_notify_events; - /* called at pre-initialization */ int efi_init_early(void); /* Initialize efi execution environment */ diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index caaab685ee..d5065f296a 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -35,7 +35,7 @@ LIST_HEAD(efi_obj_list); __efi_runtime_data LIST_HEAD(efi_events);
/* List of queued events */ -LIST_HEAD(efi_event_queue); +static LIST_HEAD(efi_event_queue);
/* Flag to disable timer activity in ExitBootServices() */ static bool timers_enabled = true; @@ -44,7 +44,7 @@ static bool timers_enabled = true; bool efi_st_keep_devices;
/* List of all events registered by RegisterProtocolNotify() */ -LIST_HEAD(efi_register_notify_events); +static LIST_HEAD(efi_register_notify_events);
/* Handle of the currently executing image */ static efi_handle_t current_image;

On Wed, Apr 05, 2023 at 08:15:17PM +0800, Bin Meng wrote:
efi_event_queue and efi_register_notify_events are only referenced in efi_boottime.c
Signed-off-by: Bin Meng bmeng@tinylab.org
include/efi_loader.h | 3 --- lib/efi_loader/efi_boottime.c | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/efi_loader.h b/include/efi_loader.h index 1542b4b625..0a2083c39a 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -509,9 +509,6 @@ struct efi_register_notify_event { struct list_head handles; };
-/* List of all events registered by RegisterProtocolNotify() */ -extern struct list_head efi_register_notify_events;
/* called at pre-initialization */ int efi_init_early(void); /* Initialize efi execution environment */ diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index caaab685ee..d5065f296a 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -35,7 +35,7 @@ LIST_HEAD(efi_obj_list); __efi_runtime_data LIST_HEAD(efi_events);
/* List of queued events */ -LIST_HEAD(efi_event_queue); +static LIST_HEAD(efi_event_queue);
/* Flag to disable timer activity in ExitBootServices() */ static bool timers_enabled = true; @@ -44,7 +44,7 @@ static bool timers_enabled = true; bool efi_st_keep_devices;
/* List of all events registered by RegisterProtocolNotify() */ -LIST_HEAD(efi_register_notify_events); +static LIST_HEAD(efi_register_notify_events);
/* Handle of the currently executing image */ static efi_handle_t current_image; -- 2.34.1
Reviewed-by: Ilias Apalodimas ilias.apalodimas@linaro.org

efi_mem is only referenced in efi_memory.c
Signed-off-by: Bin Meng bmeng@tinylab.org ---
lib/efi_loader/efi_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index b7bee98f79..219b520a0d 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -33,7 +33,7 @@ struct efi_mem_list { #define EFI_CARVE_OVERLAPS_NONRAM -3
/* This list contains all memory map items */ -LIST_HEAD(efi_mem); +static LIST_HEAD(efi_mem);
#ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER void *efi_bounce_buffer;

On Wed, Apr 05, 2023 at 08:15:18PM +0800, Bin Meng wrote:
efi_mem is only referenced in efi_memory.c
Signed-off-by: Bin Meng bmeng@tinylab.org
lib/efi_loader/efi_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index b7bee98f79..219b520a0d 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -33,7 +33,7 @@ struct efi_mem_list { #define EFI_CARVE_OVERLAPS_NONRAM -3
/* This list contains all memory map items */ -LIST_HEAD(efi_mem); +static LIST_HEAD(efi_mem);
#ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER void *efi_bounce_buffer; -- 2.34.1
Reviewed-by: Ilias Apalodimas ilias.apalodimas@linaro.org

efi_runtime_mmio is only referenced in efi_boottime.c
Signed-off-by: Bin Meng bmeng@tinylab.org ---
lib/efi_loader/efi_runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index cee96bfc7f..bf54d6ad87 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -32,7 +32,7 @@ struct efi_runtime_mmio_list { };
/* This list contains all runtime available mmio regions */ -LIST_HEAD(efi_runtime_mmio); +static LIST_HEAD(efi_runtime_mmio);
static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void);

On Wed, Apr 05, 2023 at 08:15:19PM +0800, Bin Meng wrote:
efi_runtime_mmio is only referenced in efi_boottime.c
Signed-off-by: Bin Meng bmeng@tinylab.org
lib/efi_loader/efi_runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index cee96bfc7f..bf54d6ad87 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -32,7 +32,7 @@ struct efi_runtime_mmio_list { };
/* This list contains all runtime available mmio regions */ -LIST_HEAD(efi_runtime_mmio); +static LIST_HEAD(efi_runtime_mmio);
static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void);
-- 2.34.1
Reviewed-by: Ilias Apalodimas ilias.apalodimas@linaro.org

On Wed, Apr 05, 2023 at 08:15:15PM +0800, Bin Meng wrote:
record is only referenced in efi_selftest_exitbootservices.c
Signed-off-by: Bin Meng bmeng@tinylab.org
lib/efi_selftest/efi_selftest_exitbootservices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_selftest/efi_selftest_exitbootservices.c b/lib/efi_selftest/efi_selftest_exitbootservices.c index 11b43fdd90..b090ce74d2 100644 --- a/lib/efi_selftest/efi_selftest_exitbootservices.c +++ b/lib/efi_selftest/efi_selftest_exitbootservices.c @@ -27,7 +27,7 @@ struct notification_context {
static struct efi_boot_services *boottime; static struct efi_event *efi_st_event_notify; -struct notification_record record; +static struct notification_record record;
struct notification_context context_before = { .record = &record, -- 2.34.1
Reviewed-by: Ilias Apalodimas ilias.apalodimas@linaro.org
participants (2)
-
Bin Meng
-
Ilias Apalodimas