@@ -598,13 +598,10 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
598598{
599599 struct futex_pi_state * pi_state = NULL ;
600600 struct futex_q * this , * next ;
601- struct plist_head * head ;
602601 struct task_struct * p ;
603602 pid_t pid = uval & FUTEX_TID_MASK ;
604603
605- head = & hb -> chain ;
606-
607- plist_for_each_entry_safe (this , next , head , list ) {
604+ plist_for_each_entry_safe (this , next , & hb -> chain , list ) {
608605 if (match_futex (& this -> key , key )) {
609606 /*
610607 * Another waiter already exists - bump up
@@ -986,7 +983,6 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset)
986983{
987984 struct futex_hash_bucket * hb ;
988985 struct futex_q * this , * next ;
989- struct plist_head * head ;
990986 union futex_key key = FUTEX_KEY_INIT ;
991987 int ret ;
992988
@@ -999,9 +995,8 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset)
999995
1000996 hb = hash_futex (& key );
1001997 spin_lock (& hb -> lock );
1002- head = & hb -> chain ;
1003998
1004- plist_for_each_entry_safe (this , next , head , list ) {
999+ plist_for_each_entry_safe (this , next , & hb -> chain , list ) {
10051000 if (match_futex (& this -> key , & key )) {
10061001 if (this -> pi_state || this -> rt_waiter ) {
10071002 ret = - EINVAL ;
@@ -1034,7 +1029,6 @@ futex_wake_op(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2,
10341029{
10351030 union futex_key key1 = FUTEX_KEY_INIT , key2 = FUTEX_KEY_INIT ;
10361031 struct futex_hash_bucket * hb1 , * hb2 ;
1037- struct plist_head * head ;
10381032 struct futex_q * this , * next ;
10391033 int ret , op_ret ;
10401034
@@ -1082,9 +1076,7 @@ futex_wake_op(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2,
10821076 goto retry ;
10831077 }
10841078
1085- head = & hb1 -> chain ;
1086-
1087- plist_for_each_entry_safe (this , next , head , list ) {
1079+ plist_for_each_entry_safe (this , next , & hb1 -> chain , list ) {
10881080 if (match_futex (& this -> key , & key1 )) {
10891081 if (this -> pi_state || this -> rt_waiter ) {
10901082 ret = - EINVAL ;
@@ -1097,10 +1089,8 @@ futex_wake_op(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2,
10971089 }
10981090
10991091 if (op_ret > 0 ) {
1100- head = & hb2 -> chain ;
1101-
11021092 op_ret = 0 ;
1103- plist_for_each_entry_safe (this , next , head , list ) {
1093+ plist_for_each_entry_safe (this , next , & hb2 -> chain , list ) {
11041094 if (match_futex (& this -> key , & key2 )) {
11051095 if (this -> pi_state || this -> rt_waiter ) {
11061096 ret = - EINVAL ;
@@ -1270,7 +1260,6 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags,
12701260 int drop_count = 0 , task_count = 0 , ret ;
12711261 struct futex_pi_state * pi_state = NULL ;
12721262 struct futex_hash_bucket * hb1 , * hb2 ;
1273- struct plist_head * head1 ;
12741263 struct futex_q * this , * next ;
12751264 u32 curval2 ;
12761265
@@ -1393,8 +1382,7 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags,
13931382 }
13941383 }
13951384
1396- head1 = & hb1 -> chain ;
1397- plist_for_each_entry_safe (this , next , head1 , list ) {
1385+ plist_for_each_entry_safe (this , next , & hb1 -> chain , list ) {
13981386 if (task_count - nr_wake >= nr_requeue )
13991387 break ;
14001388
@@ -1494,7 +1482,7 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
14941482}
14951483
14961484static inline void
1497- queue_unlock (struct futex_q * q , struct futex_hash_bucket * hb )
1485+ queue_unlock (struct futex_hash_bucket * hb )
14981486 __releases (& hb - > lock )
14991487{
15001488 spin_unlock (& hb -> lock );
@@ -1867,7 +1855,7 @@ static int futex_wait_setup(u32 __user *uaddr, u32 val, unsigned int flags,
18671855 ret = get_futex_value_locked (& uval , uaddr );
18681856
18691857 if (ret ) {
1870- queue_unlock (q , * hb );
1858+ queue_unlock (* hb );
18711859
18721860 ret = get_user (uval , uaddr );
18731861 if (ret )
@@ -1881,7 +1869,7 @@ static int futex_wait_setup(u32 __user *uaddr, u32 val, unsigned int flags,
18811869 }
18821870
18831871 if (uval != val ) {
1884- queue_unlock (q , * hb );
1872+ queue_unlock (* hb );
18851873 ret = - EWOULDBLOCK ;
18861874 }
18871875
@@ -2029,7 +2017,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, int detect,
20292017 * Task is exiting and we just wait for the
20302018 * exit to complete.
20312019 */
2032- queue_unlock (& q , hb );
2020+ queue_unlock (hb );
20332021 put_futex_key (& q .key );
20342022 cond_resched ();
20352023 goto retry ;
@@ -2081,7 +2069,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, int detect,
20812069 goto out_put_key ;
20822070
20832071out_unlock_put_key :
2084- queue_unlock (& q , hb );
2072+ queue_unlock (hb );
20852073
20862074out_put_key :
20872075 put_futex_key (& q .key );
@@ -2091,7 +2079,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, int detect,
20912079 return ret != - EINTR ? ret : - ERESTARTNOINTR ;
20922080
20932081uaddr_faulted :
2094- queue_unlock (& q , hb );
2082+ queue_unlock (hb );
20952083
20962084 ret = fault_in_user_writeable (uaddr );
20972085 if (ret )
@@ -2113,7 +2101,6 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
21132101{
21142102 struct futex_hash_bucket * hb ;
21152103 struct futex_q * this , * next ;
2116- struct plist_head * head ;
21172104 union futex_key key = FUTEX_KEY_INIT ;
21182105 u32 uval , vpid = task_pid_vnr (current );
21192106 int ret ;
@@ -2153,9 +2140,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
21532140 * Ok, other tasks may need to be woken up - check waiters
21542141 * and do the wakeup if necessary:
21552142 */
2156- head = & hb -> chain ;
2157-
2158- plist_for_each_entry_safe (this , next , head , list ) {
2143+ plist_for_each_entry_safe (this , next , & hb -> chain , list ) {
21592144 if (!match_futex (& this -> key , & key ))
21602145 continue ;
21612146 ret = wake_futex_pi (uaddr , uval , this );
0 commit comments