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.
Unified · Split
| @@ -65,7 +65,7 @@ EXPORT_PER_CPU_SYMBOL(__mmiowb_state); · 64 unmodified lines | |||
| 65 | * towards that other CPU that it should break the lock ASAP. | 65 | * towards that other CPU that it should break the lock ASAP. |
| 66 | */ | 66 | */ |
| 67 | #define BUILD_LOCK_OPS(op, locktype) \ | 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 | for (;;) { \ | 70 | for (;;) { \ |
| 71 | preempt_disable(); \ | 71 | preempt_disable(); \ |
| @@ -77,7 +77,7 @@ void __lockfunc __raw_##op##_lock(locktype##_t *lock) \ · 5 unmodified lines | |||
| 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 | unsigned long flags; \ | 82 | unsigned long flags; \ |
| 83 | \ | 83 | \ |
| @@ -95,12 +95,12 @@ unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \ · 11 unmodified lines | |||
| 95 | return flags; \ | 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 | _raw_##op##_lock_irqsave(lock); \ | 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 | unsigned long flags; \ | 105 | unsigned long flags; \ |
| 106 | \ | 106 | \ |