Commit 7918baa555140989eeee1270f48533987d48fdba

Authored by Török Edwin
Committed by Ingo Molnar
1 parent e25cf3db56

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>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -59,7 +59,7 @@
59 59 * We also put the fastpath first in the kernel image, to make sure the
60 60 * branch is predicted by the CPU as default-untaken.
61 61 */
62   -static void noinline __sched
  62 +static __used noinline void __sched
63 63 __mutex_lock_slowpath(atomic_t *lock_count);
64 64  
65 65 /***
... ... @@ -96,7 +96,7 @@
96 96 EXPORT_SYMBOL(mutex_lock);
97 97 #endif
98 98  
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);
100 100  
101 101 /***
102 102 * mutex_unlock - release the mutex
... ... @@ -268,7 +268,7 @@
268 268 /*
269 269 * Release the lock, slowpath:
270 270 */
271   -static noinline void
  271 +static __used noinline void
272 272 __mutex_unlock_slowpath(atomic_t *lock_count)
273 273 {
274 274 __mutex_unlock_common_slowpath(lock_count, 1);
... ... @@ -313,7 +313,7 @@
313 313 }
314 314 EXPORT_SYMBOL(mutex_lock_killable);
315 315  
316   -static noinline void __sched
  316 +static __used noinline void __sched
317 317 __mutex_lock_slowpath(atomic_t *lock_count)
318 318 {
319 319 struct mutex *lock = container_of(lock_count, struct mutex, count);