smccc: Use separate variables for args and results
authorAndrew Scull <ascull@google.com>
Tue, 15 Sep 2020 10:46:40 +0000 (11:46 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 15 Sep 2020 17:39:04 +0000 (18:39 +0100)
commit0794a974d74dc777a212a3c58dd236f507360348
tree009a67f0d3341aeb601496101dbdaf5ee8f1bf35
parentcf6501689012ef346cc835a38cbebb1e398d0834
smccc: Use separate variables for args and results

Using the same register-bound variable for both arguments and results
means these values share a type. That type must allow the arguments to
be assigned to it and must also be assignable to the unsigned long
fields of struct arm_smccc_res.

This restriction on types causes compiler warnings when the argument
cannot be implicitly assigned to an unsigned long, for example the
pointers that are used in the KVM hyp interface.

By separating the arguments and results into their own variables, the
type constraint is lifted allowing the arguments to avoid the need for
any type conversion.

Signed-off-by: Andrew Scull <ascull@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20200915104643.2543892-17-ascull@google.com
include/linux/arm-smccc.h