All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: linux-kernel@vger.kernel.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>,
	Maarten Lankhorst <maarten.lankhorst@canonical.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>
Subject: [PATCH v2 1/8] locking: Fix compilation of __WW_MUTEX_INITIALIZER
Date: Thu,  1 Dec 2016 11:47:04 +0000	[thread overview]
Message-ID: <20161201114711.28697-2-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20161201114711.28697-1-chris@chris-wilson.co.uk>

>From conflicting macro parameters, passing the wrong name to
__MUTEX_INITIALIZER and a stray '\', #define __WW_MUTEX_INITIALIZER was
very unhappy.

One unnecessary change was to choose to pass &ww_class instead of
implicitly taking the address of the class within the macro.

Fixes: 1b375dc30710 ("mutex: Move ww_mutex definitions to ww_mutex.h")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@redhat.com>
---
 include/linux/ww_mutex.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h
index 2bb5deb0012e..941df8c8b90e 100644
--- a/include/linux/ww_mutex.h
+++ b/include/linux/ww_mutex.h
@@ -51,10 +51,10 @@ struct ww_mutex {
 };
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
-# define __WW_CLASS_MUTEX_INITIALIZER(lockname, ww_class) \
-		, .ww_class = &ww_class
+# define __WW_CLASS_MUTEX_INITIALIZER(lockname, class) \
+		, .ww_class = class
 #else
-# define __WW_CLASS_MUTEX_INITIALIZER(lockname, ww_class)
+# define __WW_CLASS_MUTEX_INITIALIZER(lockname, class)
 #endif
 
 #define __WW_CLASS_INITIALIZER(ww_class) \
@@ -63,7 +63,7 @@ struct ww_mutex {
 		, .mutex_name = #ww_class "_mutex" }
 
 #define __WW_MUTEX_INITIALIZER(lockname, class) \
-		{ .base = { \__MUTEX_INITIALIZER(lockname) } \
+		{ .base =  __MUTEX_INITIALIZER(lockname.base) \
 		__WW_CLASS_MUTEX_INITIALIZER(lockname, class) }
 
 #define DEFINE_WW_CLASS(classname) \
-- 
2.10.2

  reply	other threads:[~2016-12-01 11:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 11:47 locking: Add kselftests for ww_mutex Chris Wilson
2016-12-01 11:47 ` Chris Wilson [this message]
2016-12-16 14:50   ` [PATCH v2 1/8] locking: Fix compilation of __WW_MUTEX_INITIALIZER Peter Zijlstra
2016-12-16 17:26     ` Chris Wilson
2017-01-14 12:52   ` [tip:locking/core] locking/ww_mutex: " tip-bot for Chris Wilson
2016-12-01 11:47 ` [PATCH v2 2/8] locking: Add ww_mutex to locktorture test Chris Wilson
2017-01-14 12:52   ` [tip:locking/core] locking/ww_mutex: " tip-bot for Chris Wilson
2016-12-01 11:47 ` [PATCH v2 3/8] locking: Begin kselftests for ww_mutex Chris Wilson
2017-01-14 12:53   ` [tip:locking/core] locking/ww_mutex: " tip-bot for Chris Wilson
2016-12-01 11:47 ` [PATCH v2 4/8] locking: Add kselftests for ww_mutex AA deadlock detection Chris Wilson
2017-01-14 12:54   ` [tip:locking/core] locking/ww_mutex: " tip-bot for Chris Wilson
2016-12-01 11:47 ` [PATCH v2 5/8] locking: Add kselftests for ww_mutex ABBA " Chris Wilson
2017-01-14 12:54   ` [tip:locking/core] locking/ww_mutex: " tip-bot for Chris Wilson
2016-12-01 11:47 ` [PATCH v2 6/8] locking: Add kselftests for resolving ww_mutex cyclic deadlocks Chris Wilson
2017-01-14 12:55   ` [tip:locking/core] locking/ww_mutex: " tip-bot for Chris Wilson
2016-12-01 11:47 ` [PATCH v2 7/8] locking: Add kselftests for ww_mutex stress Chris Wilson
2017-01-14 12:55   ` [tip:locking/core] locking/ww_mutex: " tip-bot for Chris Wilson
2017-01-19 20:13     ` Peter Zijlstra
2016-12-01 11:47 ` [PATCH v2 8/8] locking: Add ww_mutex to tools/testing/selftests Chris Wilson
2017-01-14 12:56   ` [tip:locking/core] locking/ww_mutex: " tip-bot for Chris Wilson
2017-02-22 14:29 ` locking: Add kselftests for ww_mutex Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161201114711.28697-2-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@canonical.com \
    --cc=mingo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.