summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/smp.h
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2020-12-02 18:41:03 +0000
committerMarc Zyngier <maz@kernel.org>2020-12-04 08:44:24 +0000
commitc1f45f4eb6fd8704f72d5ed64184121e9fe129a0 (patch)
treed9e2d4c62b13524ab420c5ee1ae767cf4332c2c6 /arch/arm64/include/asm/smp.h
parent6df3e14436f6ee254b1a4952d90ee8988be59c89 (diff)
downloadlinux-c1f45f4eb6fd8704f72d5ed64184121e9fe129a0.tar.bz2
arm64: Make cpu_logical_map() take unsigned int
CPU index should never be negative. Change the signature of (set_)cpu_logical_map to take an unsigned int. This still works even if the users treat the CPU index as an int, and will allow the hypervisor's implementation to check that the index is valid with a single upper-bound check. Signed-off-by: David Brazdil <dbrazdil@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20201202184122.26046-8-dbrazdil@google.com
Diffstat (limited to 'arch/arm64/include/asm/smp.h')
-rw-r--r--arch/arm64/include/asm/smp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h
index 2e7f529ec5a6..bcb01ca15325 100644
--- a/arch/arm64/include/asm/smp.h
+++ b/arch/arm64/include/asm/smp.h
@@ -46,9 +46,9 @@ DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
* Logical CPU mapping.
*/
extern u64 __cpu_logical_map[NR_CPUS];
-extern u64 cpu_logical_map(int cpu);
+extern u64 cpu_logical_map(unsigned int cpu);
-static inline void set_cpu_logical_map(int cpu, u64 hwid)
+static inline void set_cpu_logical_map(unsigned int cpu, u64 hwid)
{
__cpu_logical_map[cpu] = hwid;
}