lkml.org 
[lkml]   [2013]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] kernel/locking: mutex: simplify access to the first entry in the wait-list
Date
Use list_first_entry instead of explicitly accessing the first entry
with "head".next. The comment one line above becomes obsolete.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---

v1..v2:

- corrected the email address in the second Signed-off-by line

kernel/locking/mutex.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 4dd6e4c..4af4f9c 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -730,10 +730,9 @@ __mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
atomic_set(&lock->count, 1);

if (!list_empty(&lock->wait_list)) {
- /* get the first entry from the wait-list: */
struct mutex_waiter *waiter =
- list_entry(lock->wait_list.next,
- struct mutex_waiter, list);
+ list_first_entry(&lock->wait_list,
+ struct mutex_waiter, list);

debug_mutex_wake_waiter(lock, waiter);

--
1.7.0.4


\
 
 \ /
  Last update: 2013-12-12 13:01    [W:0.069 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site