public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel/locking: mutex: simplify access to the first entry in the wait-list
@ 2013-12-12  9:45 Andrzej Pietrasiewicz
  2013-12-12  9:53 ` Peter Zijlstra
  2013-12-12 12:46 ` Ingo Molnar
  0 siblings, 2 replies; 4+ messages in thread
From: Andrzej Pietrasiewicz @ 2013-12-12  9:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrzej Pietrasiewicz, Kyungmin Park, Marek Szyprowski,
	Peter Zijlstra, Ingo Molnar

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 <andrzej.p@samsung.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] kernel/locking: mutex: simplify access to the first entry in the wait-list
  2013-12-12  9:45 [PATCH] kernel/locking: mutex: simplify access to the first entry in the wait-list Andrzej Pietrasiewicz
@ 2013-12-12  9:53 ` Peter Zijlstra
  2013-12-12 11:28   ` Andrzej Pietrasiewicz
  2013-12-12 12:46 ` Ingo Molnar
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2013-12-12  9:53 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz
  Cc: linux-kernel, Kyungmin Park, Marek Szyprowski, Ingo Molnar

On Thu, Dec 12, 2013 at 10:45:41AM +0100, Andrzej Pietrasiewicz wrote:
> 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 <andrzej.p@samsung.com>

This is an invalid sign-off trail.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kernel/locking: mutex: simplify access to the first entry in the wait-list
  2013-12-12  9:53 ` Peter Zijlstra
@ 2013-12-12 11:28   ` Andrzej Pietrasiewicz
  0 siblings, 0 replies; 4+ messages in thread
From: Andrzej Pietrasiewicz @ 2013-12-12 11:28 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: linux-kernel, Kyungmin Park, Marek Szyprowski, Ingo Molnar

W dniu 12.12.2013 10:53, Peter Zijlstra pisze:
> On Thu, Dec 12, 2013 at 10:45:41AM +0100, Andrzej Pietrasiewicz wrote:
>> 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 <andrzej.p@samsung.com>
>
> This is an invalid sign-off trail.
>
Right... Thanks for spotting this. I will correct it and resubmit.

AP

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kernel/locking: mutex: simplify access to the first entry in the wait-list
  2013-12-12  9:45 [PATCH] kernel/locking: mutex: simplify access to the first entry in the wait-list Andrzej Pietrasiewicz
  2013-12-12  9:53 ` Peter Zijlstra
@ 2013-12-12 12:46 ` Ingo Molnar
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2013-12-12 12:46 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz
  Cc: linux-kernel, Kyungmin Park, Marek Szyprowski, Peter Zijlstra,
	Ingo Molnar


* Andrzej Pietrasiewicz <andrzej.p@samsung.com> wrote:

> 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 <andrzej.p@samsung.com>

that signoff sequence looks bogus - the first SOB should be the 
author, the last SOB the person sending the patch. If you want to 
credit someone please do it elsewhere in the changelog.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-12 12:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12  9:45 [PATCH] kernel/locking: mutex: simplify access to the first entry in the wait-list Andrzej Pietrasiewicz
2013-12-12  9:53 ` Peter Zijlstra
2013-12-12 11:28   ` Andrzej Pietrasiewicz
2013-12-12 12:46 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox