diff options
author | Qian Cai <cai@lca.pw> | 2020-01-23 15:20:51 -0500 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-02-10 11:29:24 +0000 |
commit | 345d52c184dc7de98cff63f1bfa6f90e9db19809 (patch) | |
tree | 4eae3ec94e0d4a3356c97dc0f193c11e6ab7f9cf /arch | |
parent | fca3d33d8ad61eb53eca3ee4cac476d1e31b9008 (diff) | |
download | linux-345d52c184dc7de98cff63f1bfa6f90e9db19809.tar.bz2 |
arm64/spinlock: fix a -Wunused-function warning
The commit f5bfdc8e3947 ("locking/osq: Use optimized spinning loop for
arm64") introduced a warning from Clang because vcpu_is_preempted() is
compiled away,
kernel/locking/osq_lock.c:25:19: warning: unused function 'node_cpu'
[-Wunused-function]
static inline int node_cpu(struct optimistic_spin_node *node)
^
1 warning generated.
Fix it by converting vcpu_is_preempted() to a static inline function.
Fixes: f5bfdc8e3947 ("locking/osq: Use optimized spinning loop for arm64")
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Qian Cai <cai@lca.pw>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/include/asm/spinlock.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h index 102404dc1e13..9083d6992603 100644 --- a/arch/arm64/include/asm/spinlock.h +++ b/arch/arm64/include/asm/spinlock.h @@ -18,6 +18,10 @@ * See: * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net */ -#define vcpu_is_preempted(cpu) false +#define vcpu_is_preempted vcpu_is_preempted +static inline bool vcpu_is_preempted(int cpu) +{ + return false; +} #endif /* __ASM_SPINLOCK_H */ |