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

Re: [PATCH 1/3] xen/efi: Reuse fdt_setprop_u32 and fdt_setprop_u64


  • To: Frediano Ziglio <frediano.ziglio@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Mon, 21 Jul 2025 14:13:09 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=deQOjTUVCZnMnv9CktKBpqII466lEPskS8XESm9jtW0=; b=LguX9iBCAg3reDQNPhQDVVbyyR/8utLA4BI3nm/YP+Ya6Qc1L9f6GQNqXffYD/TAeFaFDfJQvkInWNRpx/mk5Fi0tlFdoVXeVopxXni5hdJXyJmte7zOtdDIT614m7TAseaGX9HhOYgK6Y/MzenzdJii6oK8ydU+/NNj8DNbaYCFJfDYdFtd3GWnB54Cm2A233Piq5k3xWBScwuwrBEgnV5Wz4J7pdi0+BNgY2HnM4C1mk+0FvyzWRgxW78WL0IEv6dYUe7y7BlZGOnazGzZAmMf1w9btg3wApIk5WMwXx0l90FUbHnEDYo+mrY2D0xrmzF+SEpFIx4obHJednMOSA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WgYhHhNTAqv9KNSE2gnBRSy39UXyqNOuFhl5ZwRhsbf6OzDH+Qzp9skisnbpfgYx38h4Jus0+N2tGWchS1ZLkTsAR88ogO6Kyz0v6vJnH3RJyAwrL44xW+OnHRYGlsAhhgWCN2fbH4ZASrFA6ImTpyTfYX2HGEiCdd7IlP3FE/6rBB1Z2ygxO2zTeUvg0S2qcLh3rBOAFgQKIGXFPOVWu6rGhXvlkO1vw0B4cW4lUrzu+z/9TI8yIg5TK7qR1eO6kwTP+zPDk9Ih+YE5+puPhGCz2aD8itgIoWOybcUN5CSHzf7pg3CQml6BnidpHgkS5I7h1L6DwM9B62DmaXqxdQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 21 Jul 2025 12:13:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 21/07/2025 11:07, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxx>
> ---
>  xen/arch/arm/efi/efi-boot.h | 33 ++++++++++++---------------------
>  1 file changed, 12 insertions(+), 21 deletions(-)
> 
> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
> index 3dbeed3f89..a2aede21d5 100644
> --- a/xen/arch/arm/efi/efi-boot.h
> +++ b/xen/arch/arm/efi/efi-boot.h
> @@ -79,8 +79,7 @@ static int __init setup_chosen_node(void *fdt, int 
> *addr_cells, int *size_cells)
>      prop = fdt_get_property(fdt, node, "#address-cells", &len);
>      if ( !prop )
>      {
> -        val = cpu_to_fdt32(2);
> -        if ( fdt_setprop(fdt, node, "#address-cells", &val, sizeof(val)) )
> +        if ( fdt_setprop_u32(fdt, node, "#address-cells", 2) )
>              return -1;
>          *addr_cells = 2;
>      }
> @@ -90,8 +89,7 @@ static int __init setup_chosen_node(void *fdt, int 
> *addr_cells, int *size_cells)
>      prop = fdt_get_property(fdt, node, "#size-cells", &len);
>      if ( !prop )
>      {
> -        val = cpu_to_fdt32(2);
> -        if ( fdt_setprop(fdt, node, "#size-cells", &val, sizeof(val)) )
> +        if ( fdt_setprop_u32(fdt, node, "#size-cells", 2) )
>              return -1;
>          *size_cells = 2;
>      }
> @@ -251,8 +249,6 @@ static EFI_STATUS __init 
> fdt_add_uefi_nodes(EFI_SYSTEM_TABLE *sys_table,
>  {
>      int node;
>      int status;
> -    u32 fdt_val32;
> -    u64 fdt_val64;
>      int num_rsv;
>  
>     /*
> @@ -275,33 +271,28 @@ static EFI_STATUS __init 
> fdt_add_uefi_nodes(EFI_SYSTEM_TABLE *sys_table,
>          }
>      }
>  
> -    fdt_val64 = cpu_to_fdt64((u64)(uintptr_t)sys_table);
> -    status = fdt_setprop(fdt, node, "linux,uefi-system-table",
> -                         &fdt_val64, sizeof(fdt_val64));
> +    status = fdt_setprop_u64(fdt, node, "linux,uefi-system-table",
> +                             (uintptr_t)sys_table);
Don't we need explicit cast here? In other words, why did you drop them?

Other than that:
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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