Skip to content

Commit afc256e

Browse files
geertuPeter Zijlstra
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Waiman Long <[email protected]> Link: https://lkml.kernel.org/r/7201d7fb408375c6c4df541270d787b1b4a32354.1727879348.git.geert+renesas@glider.be
1 parent 8cf0b93 commit afc256e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/locking/spinlock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ EXPORT_PER_CPU_SYMBOL(__mmiowb_state);
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) \
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) \
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
\

0 commit comments

Comments
 (0)