diff options
author | Peter Zijlstra <peterz@infradead.org> | 2017-03-22 06:35:48 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-03-23 14:10:06 -0400 |
commit | 499f5aca2cdd5e958b27e2655e7e7f82524f46b1 (patch) | |
tree | dbb02bd03f93f2903bfeed13efaf6f36f2426f18 /kernel/futex.c | |
parent | e6790e4b5d5e97dc287f3496dd2cf2dbabdfdb35 (diff) |
futex: Cleanup variable names for futex_top_waiter()
futex_top_waiter() returns the top-waiter on the pi_mutex. Assinging
this to a variable 'match' totally obscures the code.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: juri.lelli@arm.com
Cc: bigeasy@linutronix.de
Cc: xlpang@redhat.com
Cc: rostedt@goodmis.org
Cc: mathieu.desnoyers@efficios.com
Cc: jdesfossez@efficios.com
Cc: dvhart@infradead.org
Cc: bristot@redhat.com
Link: http://lkml.kernel.org/r/20170322104151.554710645@infradead.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 45858ec73941..1531cc405270 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -1122,14 +1122,14 @@ static int attach_to_pi_owner(u32 uval, union futex_key *key, | |||
1122 | static int lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, | 1122 | static int lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, |
1123 | union futex_key *key, struct futex_pi_state **ps) | 1123 | union futex_key *key, struct futex_pi_state **ps) |
1124 | { | 1124 | { |
1125 | struct futex_q *match = futex_top_waiter(hb, key); | 1125 | struct futex_q *top_waiter = futex_top_waiter(hb, key); |
1126 | 1126 | ||
1127 | /* | 1127 | /* |
1128 | * If there is a waiter on that futex, validate it and | 1128 | * If there is a waiter on that futex, validate it and |
1129 | * attach to the pi_state when the validation succeeds. | 1129 | * attach to the pi_state when the validation succeeds. |
1130 | */ | 1130 | */ |
1131 | if (match) | 1131 | if (top_waiter) |
1132 | return attach_to_pi_state(uval, match->pi_state, ps); | 1132 | return attach_to_pi_state(uval, top_waiter->pi_state, ps); |
1133 | 1133 | ||
1134 | /* | 1134 | /* |
1135 | * We are the first waiter - try to look up the owner based on | 1135 | * We are the first waiter - try to look up the owner based on |
@@ -1176,7 +1176,7 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb, | |||
1176 | struct task_struct *task, int set_waiters) | 1176 | struct task_struct *task, int set_waiters) |
1177 | { | 1177 | { |
1178 | u32 uval, newval, vpid = task_pid_vnr(task); | 1178 | u32 uval, newval, vpid = task_pid_vnr(task); |
1179 | struct futex_q *match; | 1179 | struct futex_q *top_waiter; |
1180 | int ret; | 1180 | int ret; |
1181 | 1181 | ||
1182 | /* | 1182 | /* |
@@ -1202,9 +1202,9 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb, | |||
1202 | * Lookup existing state first. If it exists, try to attach to | 1202 | * Lookup existing state first. If it exists, try to attach to |
1203 | * its pi_state. | 1203 | * its pi_state. |
1204 | */ | 1204 | */ |
1205 | match = futex_top_waiter(hb, key); | 1205 | top_waiter = futex_top_waiter(hb, key); |
1206 | if (match) | 1206 | if (top_waiter) |
1207 | return attach_to_pi_state(uval, match->pi_state, ps); | 1207 | return attach_to_pi_state(uval, top_waiter->pi_state, ps); |
1208 | 1208 | ||
1209 | /* | 1209 | /* |
1210 | * No waiter and user TID is 0. We are here because the | 1210 | * No waiter and user TID is 0. We are here because the |
@@ -1294,11 +1294,11 @@ static void mark_wake_futex(struct wake_q_head *wake_q, struct futex_q *q) | |||
1294 | q->lock_ptr = NULL; | 1294 | q->lock_ptr = NULL; |
1295 | } | 1295 | } |
1296 | 1296 | ||
1297 | static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this, | 1297 | static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *top_waiter, |
1298 | struct futex_hash_bucket *hb) | 1298 | struct futex_hash_bucket *hb) |
1299 | { | 1299 | { |
1300 | struct task_struct *new_owner; | 1300 | struct task_struct *new_owner; |
1301 | struct futex_pi_state *pi_state = this->pi_state; | 1301 | struct futex_pi_state *pi_state = top_waiter->pi_state; |
1302 | u32 uninitialized_var(curval), newval; | 1302 | u32 uninitialized_var(curval), newval; |
1303 | DEFINE_WAKE_Q(wake_q); | 1303 | DEFINE_WAKE_Q(wake_q); |
1304 | bool deboost; | 1304 | bool deboost; |
@@ -1319,11 +1319,11 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this, | |||
1319 | 1319 | ||
1320 | /* | 1320 | /* |
1321 | * It is possible that the next waiter (the one that brought | 1321 | * It is possible that the next waiter (the one that brought |
1322 | * this owner to the kernel) timed out and is no longer | 1322 | * top_waiter owner to the kernel) timed out and is no longer |
1323 | * waiting on the lock. | 1323 | * waiting on the lock. |
1324 | */ | 1324 | */ |
1325 | if (!new_owner) | 1325 | if (!new_owner) |
1326 | new_owner = this->task; | 1326 | new_owner = top_waiter->task; |
1327 | 1327 | ||
1328 | /* | 1328 | /* |
1329 | * We pass it to the next owner. The WAITERS bit is always | 1329 | * We pass it to the next owner. The WAITERS bit is always |
@@ -2633,7 +2633,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) | |||
2633 | u32 uninitialized_var(curval), uval, vpid = task_pid_vnr(current); | 2633 | u32 uninitialized_var(curval), uval, vpid = task_pid_vnr(current); |
2634 | union futex_key key = FUTEX_KEY_INIT; | 2634 | union futex_key key = FUTEX_KEY_INIT; |
2635 | struct futex_hash_bucket *hb; | 2635 | struct futex_hash_bucket *hb; |
2636 | struct futex_q *match; | 2636 | struct futex_q *top_waiter; |
2637 | int ret; | 2637 | int ret; |
2638 | 2638 | ||
2639 | retry: | 2639 | retry: |
@@ -2657,9 +2657,9 @@ retry: | |||
2657 | * all and we at least want to know if user space fiddled | 2657 | * all and we at least want to know if user space fiddled |
2658 | * with the futex value instead of blindly unlocking. | 2658 | * with the futex value instead of blindly unlocking. |
2659 | */ | 2659 | */ |
2660 | match = futex_top_waiter(hb, &key); | 2660 | top_waiter = futex_top_waiter(hb, &key); |
2661 | if (match) { | 2661 | if (top_waiter) { |
2662 | ret = wake_futex_pi(uaddr, uval, match, hb); | 2662 | ret = wake_futex_pi(uaddr, uval, top_waiter, hb); |
2663 | /* | 2663 | /* |
2664 | * In case of success wake_futex_pi dropped the hash | 2664 | * In case of success wake_futex_pi dropped the hash |
2665 | * bucket lock. | 2665 | * bucket lock. |