History

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.

Geert Uytterhoeven committed 2 years ago

Commit afc256e1 parent 8cf0b931 file · +4 −4Browse files

Showing the changes to kernel/locking (1 of 1 file). Show all

Unified · Split

kernel/locking/spinlock.c+4−4
@@ -65,7 +65,7 @@ EXPORT_PER_CPU_SYMBOL(__mmiowb_state); · 64 unmodified lines
6565 * towards that other CPU that it should break the lock ASAP.
6666 */
6767 #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) \
6969 { \
7070 for (;;) { \
7171 preempt_disable(); \
@@ -77,7 +77,7 @@ void __lockfunc __raw_##op##_lock(locktype##_t *lock) \ · 5 unmodified lines
7777 } \
7878 } \
7979 \
80−unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \
80+static unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \
8181 { \
8282 unsigned long flags; \
8383 \
@@ -95,12 +95,12 @@ unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \ · 11 unmodified lines
9595 return flags; \
9696 } \
9797 \
98−void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \
98+static void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \
9999 { \
100100 _raw_##op##_lock_irqsave(lock); \
101101 } \
102102 \
103−void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \
103+static void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \
104104 { \
105105 unsigned long flags; \
106106 \