Skip to content

Commit 7918baa

Browse files
edwintorokIngo Molnar
authored andcommitted
mutex: __used is needed for function referenced only from inline asm
Impact: fix build failure on llvm-gcc-4.2 According to the gcc manual, the 'used' attribute should be applied to functions referenced only from inline assembly. This fixes a build failure with llvm-gcc-4.2, which deleted __mutex_lock_slowpath, __mutex_unlock_slowpath. Signed-off-by: Török Edwin <edwintorok@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent e25cf3d commit 7918baa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎kernel/mutex.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(__mutex_init);
5959
* We also put the fastpath first in the kernel image, to make sure the
6060
* branch is predicted by the CPU as default-untaken.
6161
*/
62-
static void noinline __sched
62+
static __used noinline void __sched
6363
__mutex_lock_slowpath(atomic_t *lock_count);
6464

6565
/***
@@ -96,7 +96,7 @@ void inline __sched mutex_lock(struct mutex *lock)
9696
EXPORT_SYMBOL(mutex_lock);
9797
#endif
9898

99-
static noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count);
99+
static __used noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count);
100100

101101
/***
102102
* mutex_unlock - release the mutex
@@ -268,7 +268,7 @@ __mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
268268
/*
269269
* Release the lock, slowpath:
270270
*/
271-
static noinline void
271+
static __used noinline void
272272
__mutex_unlock_slowpath(atomic_t *lock_count)
273273
{
274274
__mutex_unlock_common_slowpath(lock_count, 1);
@@ -313,7 +313,7 @@ int __sched mutex_lock_killable(struct mutex *lock)
313313
}
314314
EXPORT_SYMBOL(mutex_lock_killable);
315315

316-
static noinline void __sched
316+
static __used noinline void __sched
317317
__mutex_lock_slowpath(atomic_t *lock_count)
318318
{
319319
struct mutex *lock = container_of(lock_count, struct mutex, count);

0 commit comments

Comments
 (0)