]> xenbits.xensource.com Git - xen.git/commitdiff
EFI: constify EFI_LOADED_IMAGE * function parameters
authorJan Beulich <jbeulich@suse.com>
Fri, 10 Dec 2021 13:02:59 +0000 (14:02 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Dec 2021 13:02:59 +0000 (14:02 +0100)
Instead of altering Arm's forward declarations, drop them. Like
elsewhere we should limit such to cases where the first use lives ahead
of the definition.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/efi/efi-boot.h
xen/arch/x86/efi/efi-boot.h
xen/common/efi/boot.c

index c4ed41284597764d5159d7d575d585bd88ed1016..4fb345f225c85ade08fb7b4689f42662f101e743 100644 (file)
@@ -44,20 +44,6 @@ void __flush_dcache_area(const void *vaddr, unsigned long size);
 
 static int get_module_file_index(const char *name, unsigned int name_len);
 static void PrintMessage(const CHAR16 *s);
-static int allocate_module_file(EFI_LOADED_IMAGE *loaded_image,
-                                EFI_FILE_HANDLE *dir_handle,
-                                const char *name,
-                                unsigned int name_len);
-static int handle_module_node(EFI_LOADED_IMAGE *loaded_image,
-                              EFI_FILE_HANDLE *dir_handle,
-                              int module_node_offset,
-                              int reg_addr_cells,
-                              int reg_size_cells,
-                              bool is_domu_module);
-static int handle_dom0less_domain_node(EFI_LOADED_IMAGE *loaded_image,
-                                       EFI_FILE_HANDLE *dir_handle,
-                                       int domain_node);
-static int efi_check_dt_boot(EFI_LOADED_IMAGE *loaded_image);
 
 #define DEVICE_TREE_GUID \
 {0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
@@ -650,7 +636,7 @@ static void __init PrintMessage(const CHAR16 *s)
  * This function allocates a binary and keeps track of its name, it returns the
  * index of the file in the modules array or a negative number on error.
  */
-static int __init allocate_module_file(EFI_LOADED_IMAGE *loaded_image,
+static int __init allocate_module_file(const EFI_LOADED_IMAGE *loaded_image,
                                        EFI_FILE_HANDLE *dir_handle,
                                        const char *name,
                                        unsigned int name_len)
@@ -713,7 +699,7 @@ static int __init allocate_module_file(EFI_LOADED_IMAGE *loaded_image,
  * for the reg property into the module DT node.
  * Returns 1 if module is multiboot,module, 0 if not, < 0 on error
  */
-static int __init handle_module_node(EFI_LOADED_IMAGE *loaded_image,
+static int __init handle_module_node(const EFI_LOADED_IMAGE *loaded_image,
                                      EFI_FILE_HANDLE *dir_handle,
                                      int module_node_offset,
                                      int reg_addr_cells,
@@ -814,7 +800,7 @@ static int __init handle_module_node(EFI_LOADED_IMAGE *loaded_image,
  * in the DT.
  * Returns number of multiboot,module found or negative number on error.
  */
-static int __init handle_dom0less_domain_node(EFI_LOADED_IMAGE *loaded_image,
+static int __init handle_dom0less_domain_node(const EFI_LOADED_IMAGE *loaded_image,
                                               EFI_FILE_HANDLE *dir_handle,
                                               int domain_node)
 {
@@ -862,7 +848,7 @@ static int __init handle_dom0less_domain_node(EFI_LOADED_IMAGE *loaded_image,
  * dom0 and domU guests to be loaded.
  * Returns the number of multiboot modules found or a negative number for error.
  */
-static int __init efi_check_dt_boot(EFI_LOADED_IMAGE *loaded_image)
+static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image)
 {
     int chosen, node, addr_len, size_len;
     unsigned int i = 0, modules_found = 0;
@@ -942,7 +928,7 @@ static void __init efi_arch_halt(void)
     stop_cpu();
 }
 
-static void __init efi_arch_load_addr_check(EFI_LOADED_IMAGE *loaded_image)
+static void __init efi_arch_load_addr_check(const EFI_LOADED_IMAGE *loaded_image)
 {
     if ( (unsigned long)loaded_image->ImageBase & ((1 << 12) - 1) )
         blexit(L"Xen must be loaded at a 4 KByte boundary.");
index 9b0cc29aae8080b8d3e4c7406fb8d1606e8de325..f69509a2103ac2a58bb3bc4769967504115212c2 100644 (file)
@@ -709,7 +709,7 @@ static void __init efi_arch_halt(void)
         halt();
 }
 
-static void __init efi_arch_load_addr_check(EFI_LOADED_IMAGE *loaded_image)
+static void __init efi_arch_load_addr_check(const EFI_LOADED_IMAGE *loaded_image)
 {
     xen_phys_start = (UINTN)loaded_image->ImageBase;
     if ( (xen_phys_start + loaded_image->ImageSize - 1) >> 32 )
index 114ea8278f58cc71b82140a0687fc45c64ae3f6e..5ceb535ad0d87f3f08dc6250eca2cd3309562060 100644 (file)
@@ -389,7 +389,7 @@ static unsigned int __init get_argv(unsigned int argc, CHAR16 **argv,
     return argc;
 }
 
-static EFI_FILE_HANDLE __init get_parent_handle(EFI_LOADED_IMAGE *loaded_image,
+static EFI_FILE_HANDLE __init get_parent_handle(const EFI_LOADED_IMAGE *loaded_image,
                                                 CHAR16 **leaf)
 {
     static EFI_GUID __initdata fs_protocol = SIMPLE_FILE_SYSTEM_PROTOCOL;
@@ -561,7 +561,7 @@ static int __init __maybe_unused set_color(uint32_t mask, int bpp,
 }
 
 #ifndef CONFIG_HAS_DEVICE_TREE
-static int __init efi_check_dt_boot(EFI_LOADED_IMAGE *loaded_image)
+static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image)
 {
     return 0;
 }