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 <[email protected]>
> ---
> CC: Stefano Stabellini <[email protected]>
> CC: Julien Grall <[email protected]>
> CC: Volodymyr Babchuk <[email protected]>
> CC: Bertrand Marquis <[email protected]>
> CC: Michal Orzel <[email protected]>
> 
> 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 <[email protected]>

~Michal


Reply via email to