Commit 345d52c1 authored by Qian Cai's avatar Qian Cai Committed by Will Deacon

arm64/spinlock: fix a -Wunused-function warning

The commit f5bfdc8e ("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: f5bfdc8e ("locking/osq: Use optimized spinning loop for arm64")
Acked-by: default avatarWaiman Long <longman@redhat.com>
Signed-off-by: default avatarQian Cai <cai@lca.pw>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent fca3d33d
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
* See: * See:
* https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net * 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 */ #endif /* __ASM_SPINLOCK_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment