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

Re: [PATCH 2/2] xen/arm: Simplify type handling for SMCCC declarations


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Tue, 24 Feb 2026 15:18:07 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=WhAwpyF4eVpKJr+13Ng33DywkWY82AX1hItQ16FOarU=; b=u5PknNkIitPjmLFnEnKrai8uyeYH17aUAGj22RlrmhOacQKXxuc/InT5kkimpqHWIZTLDq5G7fw9R/DTiEhl07BvP9cLkgx0OsJDxDNrN6ziDth2jTCewWm3xapADFyLsifw+OG6Kh4OV02kDIJDBXk0ekLl/ASlw7GrSZ/anj7O9ZIfO8rFRokCMFiSn/As0Kwlu5ZoZqX9/0+PLAVOpKavtirNBCfAt6xfZkHEFCBBtR3oIwzdY78GOy6VswYXaL8pSm1lYHqWQJ7/Kp3istVHfLG54J6ekePL0N9AMKjjWEhHjN01x8d+VMKk2Caz0etplYQq3vguWNWPzsgQIQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VBJPock3sGKEZtZBwv1+ErcJX2qNdrHC97mv8a3Rcnv3jWni59PlHML6FGEHqKcIXhUWCyQ8bQcfD497k8JKk83kSZGIqlOC64ZKShYEqqMK8yrPLY5TC9qOxg73eRmvd0XuGYKlAgofkz8wBe088S1LL9GTOUZ7197og+4CaAbXMnIZgCXy5fSCKNUvE8BoOOVoSW82Gp8a8s84CoiQO8AfqQHQuksrr81Svh7RMXR92Aa1me6ah9sddxUDPK+A4guavUWA1OMV0NbC7LF2+t9YAIkwbHvWZLM72Dhlsk9hIUGOSPYmkf1SCwcFO4J5sa7cZnxGzVKjRDK7kXUcRg==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Tue, 24 Feb 2026 14:18:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 24/02/2026 13:45, Andrew Cooper wrote:
> There's no use creating a typed copy of a macro argument, simply to use it to
> create a second typed copy.  Remove the indirection, halving the number of
> local variables created in scope.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> CC: Julien Grall <julien@xxxxxxx>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> CC: Michal Orzel <michal.orzel@xxxxxxx>
> 
> This also makes them clearly elliglbe for converstion to auto, where they
> weren't before (typeof expression not being that of the RHS).
> ---
>  xen/arch/arm/include/asm/smccc.h | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/smccc.h 
> b/xen/arch/arm/include/asm/smccc.h
> index 347c4526d12a..7e90b0b56550 100644
> --- a/xen/arch/arm/include/asm/smccc.h
> +++ b/xen/arch/arm/include/asm/smccc.h
> @@ -113,39 +113,32 @@ struct arm_smccc_res {
>      register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0)
>  
>  #define __declare_arg_1(a0, a1, res)                        \
> -    typeof(a1) __a1 = (a1);                                 \
>      __declare_arg_0(a0, res);                               \
> -    register typeof(a1)     arg1 ASM_REG(1) = __a1
> +    register typeof(a1)     arg1 ASM_REG(1) = a1
>  
>  #define __declare_arg_2(a0, a1, a2, res)                    \
> -    typeof(a1) __a1 = (a1);                                 \
>      __declare_arg_1(a0, a1, res);                           \
> -    register typeof(a2)     arg2 ASM_REG(2) = __a2
> +    register typeof(a2)     arg2 ASM_REG(2) = a2
Here you fix the issue introduced in patch 1/2 :) You drop typeof(a1) and
replace it with correct typeof(a2).

Provided this patch is rebased on fixed 1/2:
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®.