diff options
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/locks.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c index 35bd03c41dd1..8362fa272ca5 100644 --- a/arch/powerpc/lib/locks.c +++ b/arch/powerpc/lib/locks.c | |||
@@ -28,15 +28,13 @@ | |||
28 | void __spin_yield(raw_spinlock_t *lock) | 28 | void __spin_yield(raw_spinlock_t *lock) |
29 | { | 29 | { |
30 | unsigned int lock_value, holder_cpu, yield_count; | 30 | unsigned int lock_value, holder_cpu, yield_count; |
31 | struct paca_struct *holder_paca; | ||
32 | 31 | ||
33 | lock_value = lock->slock; | 32 | lock_value = lock->slock; |
34 | if (lock_value == 0) | 33 | if (lock_value == 0) |
35 | return; | 34 | return; |
36 | holder_cpu = lock_value & 0xffff; | 35 | holder_cpu = lock_value & 0xffff; |
37 | BUG_ON(holder_cpu >= NR_CPUS); | 36 | BUG_ON(holder_cpu >= NR_CPUS); |
38 | holder_paca = &paca[holder_cpu]; | 37 | yield_count = lppaca[holder_cpu].yield_count; |
39 | yield_count = holder_paca->lppaca.yield_count; | ||
40 | if ((yield_count & 1) == 0) | 38 | if ((yield_count & 1) == 0) |
41 | return; /* virtual cpu is currently running */ | 39 | return; /* virtual cpu is currently running */ |
42 | rmb(); | 40 | rmb(); |
@@ -60,15 +58,13 @@ void __rw_yield(raw_rwlock_t *rw) | |||
60 | { | 58 | { |
61 | int lock_value; | 59 | int lock_value; |
62 | unsigned int holder_cpu, yield_count; | 60 | unsigned int holder_cpu, yield_count; |
63 | struct paca_struct *holder_paca; | ||
64 | 61 | ||
65 | lock_value = rw->lock; | 62 | lock_value = rw->lock; |
66 | if (lock_value >= 0) | 63 | if (lock_value >= 0) |
67 | return; /* no write lock at present */ | 64 | return; /* no write lock at present */ |
68 | holder_cpu = lock_value & 0xffff; | 65 | holder_cpu = lock_value & 0xffff; |
69 | BUG_ON(holder_cpu >= NR_CPUS); | 66 | BUG_ON(holder_cpu >= NR_CPUS); |
70 | holder_paca = &paca[holder_cpu]; | 67 | yield_count = lppaca[holder_cpu].yield_count; |
71 | yield_count = holder_paca->lppaca.yield_count; | ||
72 | if ((yield_count & 1) == 0) | 68 | if ((yield_count & 1) == 0) |
73 | return; /* virtual cpu is currently running */ | 69 | return; /* virtual cpu is currently running */ |
74 | rmb(); | 70 | rmb(); |