Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

locking/spinlocks: Make __raw_* lock ops static

If CONFIG_GENERIC_LOCKBREAK=y and CONFIG_DEBUG_LOCK_ALLOC=n
(e.g. sh/sdk7786_defconfig):

kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_spin_lock' [-Wmissing-prototypes]
kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_spin_lock_irqsave' [-Wmissing-prototypes]
kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_spin_lock_irq' [-Wmissing-prototypes]
kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_spin_lock_bh' [-Wmissing-prototypes]
kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_read_lock' [-Wmissing-prototypes]
kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_read_lock_irqsave' [-Wmissing-prototypes]
kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_read_lock_irq' [-Wmissing-prototypes]
kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_read_lock_bh' [-Wmissing-prototypes]
kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_write_lock' [-Wmissing-prototypes]
kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_write_lock_irqsave' [-Wmissing-prototypes]
kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_write_lock_irq' [-Wmissing-prototypes]
kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_write_lock_bh' [-Wmissing-prototypes]

All __raw_* lock ops are internal functions without external callers.
Hence fix this by making them static.

Note that if CONFIG_GENERIC_LOCKBREAK=y, no lock ops are inlined, as all
of CONFIG_INLINE_*_LOCK* depend on !GENERIC_LOCKBREAK.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://lkml.kernel.org/r/7201d7fb408375c6c4df541270d787b1b4a32354.1727879348.git.geert+renesas@glider.be

authored by

Geert Uytterhoeven and committed by
Peter Zijlstra
afc256e1 8cf0b939

+4 -4
+4 -4
kernel/locking/spinlock.c
··· 65 65 * towards that other CPU that it should break the lock ASAP. 66 66 */ 67 67 #define BUILD_LOCK_OPS(op, locktype) \ 68 - void __lockfunc __raw_##op##_lock(locktype##_t *lock) \ 68 + static void __lockfunc __raw_##op##_lock(locktype##_t *lock) \ 69 69 { \ 70 70 for (;;) { \ 71 71 preempt_disable(); \ ··· 77 77 } \ 78 78 } \ 79 79 \ 80 - unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \ 80 + static unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \ 81 81 { \ 82 82 unsigned long flags; \ 83 83 \ ··· 95 95 return flags; \ 96 96 } \ 97 97 \ 98 - void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \ 98 + static void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \ 99 99 { \ 100 100 _raw_##op##_lock_irqsave(lock); \ 101 101 } \ 102 102 \ 103 - void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \ 103 + static void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \ 104 104 { \ 105 105 unsigned long flags; \ 106 106 \