From: Jes Sorensen <jes@sgi.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [patch -mm] notifier chain initialization
Date: 22 Mar 2006 11:11:07 -0500 [thread overview]
Message-ID: <yq0y7z2tq78.fsf@jaguar.mkp.net> (raw)
Hi,
This one is against the -mm tree, description below.
Cheers,
Jes
This patch goes on top of Alan Stern's
notifier-chain-update-api-changes.patch
It restructures the notifier chain initialization macros by
introducing FOO_NOTIFIER_INIT() macros which are used by the
FOO_NOTIFIER_HEAD() macros.
The benefit is that one can use the FOO_NOTIFIER_INIT() macro for
static initialization of a notifier chain.
Signed-off-by: Jes Sorensen <jes@sgi.com>
---
include/linux/notifier.h | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
Index: linux-2.6/include/linux/notifier.h
===================================================================
--- linux-2.6.orig/include/linux/notifier.h
+++ linux-2.6/include/linux/notifier.h
@@ -64,17 +64,24 @@
(name)->head = NULL; \
} while (0)
-#define ATOMIC_NOTIFIER_HEAD(name) \
- struct atomic_notifier_head name = { \
+#define ATOMIC_NOTIFIER_INIT(name) { \
.mutex = __MUTEX_INITIALIZER((name).mutex), \
.head = NULL }
-#define BLOCKING_NOTIFIER_HEAD(name) \
- struct blocking_notifier_head name = { \
+#define BLOCKING_NOTIFIER_INIT(name) { \
.rwsem = __RWSEM_INITIALIZER((name).rwsem), \
.head = NULL }
+#define RAW_NOTIFIER_INIT(name) { \
+ .head = NULL }
+
+#define ATOMIC_NOTIFIER_HEAD(name) \
+ struct atomic_notifier_head name = \
+ ATOMIC_NOTIFIER_INIT(name)
+#define BLOCKING_NOTIFIER_HEAD(name) \
+ struct blocking_notifier_head name = \
+ BLOCKING_NOTIFIER_INIT(name)
#define RAW_NOTIFIER_HEAD(name) \
- struct raw_notifier_head name = { \
- .head = NULL }
+ struct raw_notifier_head name = \
+ RAW_NOTIFIER_INIT(name)
#ifdef __KERNEL__
next reply other threads:[~2006-03-22 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-22 16:11 Jes Sorensen [this message]
2006-03-22 17:05 ` Alan Stern
2006-03-22 21:10 ` Jes Sorensen
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=yq0y7z2tq78.fsf@jaguar.mkp.net \
--to=jes@sgi.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®