Skip to content

Commit 345d52c

Browse files
Qian Caiwilldeacon
authored andcommitted
arm64/spinlock: fix a -Wunused-function warning
The commit f5bfdc8 ("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: f5bfdc8 ("locking/osq: Use optimized spinning loop for arm64") Acked-by: Waiman Long <[email protected]> Signed-off-by: Qian Cai <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent fca3d33 commit 345d52c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm64/include/asm/spinlock.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
* See:
1919
* https://lore.kernel.org/lkml/[email protected]
2020
*/
21-
#define vcpu_is_preempted(cpu) false
21+
#define vcpu_is_preempted vcpu_is_preempted
22+
static inline bool vcpu_is_preempted(int cpu)
23+
{
24+
return false;
25+
}
2226

2327
#endif /* __ASM_SPINLOCK_H */

0 commit comments

Comments
 (0)