[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] EFI: constify EFI_LOADED_IMAGE * function parameters


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Fri, 3 Dec 2021 16:11:13 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zH3HvH4aM5H9UhOvfuZBtBMWLykdiyXiuBdAVWV3zSw=; b=IK/IsRNuTTzIR6IeD06r/c7sTYZdK27WOCVR9bD3KOe2QdmU+P65Vzs7GJnoBwSuHvR2dbZf/+1wWbN9Hr5jWULlONW4/b+qHyXI1980n+IeXb4D5hBlBzR7jZArqwk2dvUt/IDeCRYjx8+NmtWXrS9P2f/v6Cu3Z4zcNsbvh0qfJSZfkhY/tufW+UxIPKYu0ArlTzgPwH3J+Yz3oj1spPRf5rVHnHL/PLgGxYUD0zGhUHs5bhjd+cSD2/euT3LpigfHa/zuROgeo11+U+QcOX1CpAe7ZxJ/izhe93W4dSe11EZAUgPsF2VsphHh8NqsnhNIp6PNELlhGQy+f5ydjA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eAz1qZ8m9e8VCaM2aJpyDvDiAp0NibZ290K3JKjS4FtMutfU/r5lRoUZlK1y1mOZOXNX80jMX2d3KlB+1fMmv3g+wQ4XBMgtMpghfCU9I8VMl7UPYJ01vkdJAzQ7EWt5DdjQRvatAuOED9Dmzex+evHWpDWCINAUG5erJimrVupZw8X40GMZ6hyQuSYF8kkt9Bj24+Kr4tqI7QkvS4fyY0gdD4kCk9Ik7+OqA3FSrMgjE1QN2Qr2eZOaS5kcBF2PaG3SMEHTuMf4boRl4xNtxgQArdC3fhClcVTWH3HyGbbs1t1ZgY8C3NZW/xPDpWIVEEyswph20XnJSbv7CAi5+g==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 03 Dec 2021 16:11:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;


> On 3 Dec 2021, at 10:57, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> 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.
> 

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> --- 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;
> }
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.