mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Define a macro for subsys_initcall_sync() -> module_init().
Date: Tue, 5 Aug 2008 22:19:32 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0808052211290.20955@localhost.localdomain> (raw)


Define the macro subsys_initcall_sync() to map to module_init() so
that module code can stop horrifically abusing fs_initcall().

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

currently, a number of source files under drivers/ will use a call to
fs_initcall() instead of module_init() to get precise control over
when that code runs if it is compiled into the kernel -- that is, to
*guarantee* that that code runs after all subsys initcalls but before
any device initcalls.

it's not clear that that level of fine-grained control is truly
necessary in *all* of those cases but, if it is, then it makes more
sense to use subsys_initcall_sync(), since it semantically makes more
sense in showing when that happens.  using fs_initcall() is just an
ugly hack.

this seems like it wouldn't introduce any problems since there are no
invocations of subsys_initcall_sync() anywhere in the source tree at
the moment.

diff --git a/include/linux/init.h b/include/linux/init.h
index 11b84e1..38e4550 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -276,6 +276,7 @@ void __init parse_early_param(void);
 #define postcore_initcall(fn)		module_init(fn)
 #define arch_initcall(fn)		module_init(fn)
 #define subsys_initcall(fn)		module_init(fn)
+#define subsys_initcall_sync(fn)	module_init(fn)
 #define fs_initcall(fn)			module_init(fn)
 #define device_initcall(fn)		module_init(fn)
 #define late_initcall(fn)		module_init(fn)

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

                 reply	other threads:[~2008-08-06  2:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.LFD.1.10.0808052211290.20955@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=linux-kernel@vger.kernel.org \
    /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®