Re: [PATCH v3 14/18] smccc: Cast arguments to unsigned long

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

 



On Thu, 03 Sep 2020 14:53:03 +0100,
Andrew Scull <ascull@xxxxxxxxxx> wrote:
> 
> To avoid warning about implicit casting, make the casting explicit. This
> allows, for example, pointers to be used as arguments as are used in the
> KVM hyp interface.
> 
> Cc: Sudeep Holla <sudeep.holla@xxxxxxx>
> Signed-off-by: Andrew Scull <ascull@xxxxxxxxxx>
> ---
>  include/linux/arm-smccc.h | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> index 15c706fb0a37..3bb109a35554 100644
> --- a/include/linux/arm-smccc.h
> +++ b/include/linux/arm-smccc.h
> @@ -260,7 +260,7 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,
>  	typeof(a1) __a1 = a1;						\
>  	struct arm_smccc_res   *___res = res;				\
>  	register unsigned long r0 asm("r0") = (u32)a0;			\
> -	register unsigned long r1 asm("r1") = __a1;			\
> +	register unsigned long r1 asm("r1") = (unsigned long)__a1;	\

Given the pain we go through to extract the type of each argument, it
seems odd to end-up with casts everywhere. I'd rather keep the type
system alive by having:

	register typeof(a1) r1 asm("r1") = __a1;

Is there any reason why this doesn't work?

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux