All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: [PATCH 2/3] EFI: constify EFI_LOADED_IMAGE * function parameters
Date: Fri, 3 Dec 2021 11:57:33 +0100	[thread overview]
Message-ID: <d9664972-b0b8-605c-403d-4e2340442cae@suse.com> (raw)
In-Reply-To: <46de3a57-76d0-1538-ec3b-79290d1bfb70@suse.com>

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>

--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -44,20 +44,6 @@ void __flush_dcache_area(const void *vad
 
 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 CH
  * 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(E
  * 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
  * 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
  * 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.");
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -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 )
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -389,7 +389,7 @@ static unsigned int __init get_argv(unsi
     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_col
 }
 
 #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;
 }



  parent reply	other threads:[~2021-12-03 10:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 10:54 [PATCH 0/3]: EFI: some tidying Jan Beulich
2021-12-03 10:56 ` [PATCH 1/3] EFI: move efi-boot.h inclusion point Jan Beulich
2021-12-03 11:21   ` Andrew Cooper
2021-12-03 11:25     ` Jan Beulich
2021-12-03 11:26       ` Andrew Cooper
2021-12-03 12:50     ` Jan Beulich
2021-12-03 15:51       ` Andrew Cooper
2021-12-03 16:10   ` Luca Fancellu
2021-12-06  7:27     ` Jan Beulich
2021-12-06  8:39       ` Luca Fancellu
2021-12-03 10:57 ` Jan Beulich [this message]
2021-12-03 16:11   ` [PATCH 2/3] EFI: constify EFI_LOADED_IMAGE * function parameters Luca Fancellu
2021-12-10  9:44   ` Ping: " Jan Beulich
2021-12-10 10:07     ` Julien Grall
2021-12-03 10:58 ` [PATCH 3/3] EFI: drop copy-in from QueryVariableInfo()'s OUT-only variable bouncing Jan Beulich
2021-12-03 16:11   ` Luca Fancellu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9664972-b0b8-605c-403d-4e2340442cae@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.