Skip to contentSkip to conversation

efi: selftest: Make record static

PATCH In review Bin Meng 2 participants 10 messages Apr 5, 2023

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/5 efi: selftest: Make record static

record is only referenced in efi_selftest_exitbootservices.c

---

 lib/efi_selftest/efi_selftest_exitbootservices.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_selftest/efi_selftest_exitbootservices.c +1 -1
index 11b43fdd90..b090ce74d2 100644
@@ -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,
Signature · 1 line
2.34.1
Reviewed-by on v1 1/5
#1 lore raw
Quoted 24 lines · Bin Meng

record is only referenced in efi_selftest_exitbootservices.c

---

 lib/efi_selftest/efi_selftest_exitbootservices.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_selftest/efi_selftest_exitbootservices.c +1 -1
index 11b43fdd90..b090ce74d2 100644
@@ -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,
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 2/5 efi: selftest: Make load_file() and load_file2() static

In reply to Bin Meng

load_file() and load_file2() are only referenced in efi_selftest_load_file.c

---

 lib/efi_selftest/efi_selftest_load_file.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
lib/efi_selftest/efi_selftest_load_file.c +10 -10
index 8784a76172..14df761172 100644
@@ -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,
Signature · 1 line
2.34.1
Reviewed-by on v1 2/5
#3 lore raw

Re: [PATCH 2/5] efi: selftest: Make load_file() and load_file2() static

Quoted 50 lines · Bin Meng

load_file() and load_file2() are only referenced in efi_selftest_load_file.c

---

 lib/efi_selftest/efi_selftest_load_file.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
lib/efi_selftest/efi_selftest_load_file.c +10 -10
index 8784a76172..14df761172 100644
@@ -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,
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH 3/5 efi: loader: Make efi_event_queue and efi_register_notify_events static

In reply to Bin Meng

efi_event_queue and efi_register_notify_events are only referenced in efi_boottime.c

---

 include/efi_loader.h          | 3 ---
 lib/efi_loader/efi_boottime.c | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
include/efi_loader.h +0 -3
index 1542b4b625..0a2083c39a 100644
@@ -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 */
lib/efi_loader/efi_boottime.c +2 -2
index caaab685ee..d5065f296a 100644
@@ -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;
Signature · 1 line
2.34.1
Reviewed-by on v1 3/5
#5 lore raw

Re: [PATCH 3/5] efi: loader: Make efi_event_queue and efi_register_notify_events static

Quoted 49 lines · Bin Meng

efi_event_queue and efi_register_notify_events are only referenced in efi_boottime.c

---

 include/efi_loader.h          | 3 ---
 lib/efi_loader/efi_boottime.c | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
include/efi_loader.h +0 -3
index 1542b4b625..0a2083c39a 100644
@@ -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 */
lib/efi_loader/efi_boottime.c +2 -2
index caaab685ee..d5065f296a 100644
@@ -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;
Signature · 1 line
2.34.1
author
#6 lore raw

PATCH 4/5 efi: loader: Make efi_mem static

In reply to Bin Meng

efi_mem is only referenced in efi_memory.c

---

 lib/efi_loader/efi_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_memory.c +1 -1
index b7bee98f79..219b520a0d 100644
@@ -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;
Signature · 1 line
2.34.1
Reviewed-by on v1 4/5
#7 lore raw

Re: [PATCH 4/5] efi: loader: Make efi_mem static

Quoted 24 lines · Bin Meng

efi_mem is only referenced in efi_memory.c

---

 lib/efi_loader/efi_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_memory.c +1 -1
index b7bee98f79..219b520a0d 100644
@@ -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;
Signature · 1 line
2.34.1
author
#8 lore raw

PATCH 5/5 efi: loader: Make efi_runtime_mmio static

In reply to Bin Meng

efi_runtime_mmio is only referenced in efi_boottime.c

---

 lib/efi_loader/efi_runtime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_runtime.c +1 -1
index cee96bfc7f..bf54d6ad87 100644
@@ -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);
 
Signature · 1 line
2.34.1
Reviewed-by on v1 5/5
#9 lore raw

Re: [PATCH 5/5] efi: loader: Make efi_runtime_mmio static

Quoted 24 lines · Bin Meng

efi_runtime_mmio is only referenced in efi_boottime.c

---

 lib/efi_loader/efi_runtime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_runtime.c +1 -1
index cee96bfc7f..bf54d6ad87 100644
@@ -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);
 
Signature · 1 line
2.34.1