mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: backports@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Subject: [PATCH 1/3] compat: redefine core_initcall() and late_initcall()
Date: Sat,  6 Apr 2013 19:35:36 -0700	[thread overview]
Message-ID: <1365302138-19736-2-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1365302138-19736-1-git-send-email-mcgrof@do-not-panic.com>

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

It is questionable if we'd want to backport calls declared
through late_initcall() or core_initcall() on the kernel
but if this ends up being desired the current of copying
kernel code requires either patching or redefining these
symbols to make them build.

To avoid having to maintain patches for these components
and having to delcare these routines on header files through
compat manually use these init macros to help us define
symbols we *can* use on the compat module init.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/include/linux/compat-2.6.h |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/backport/include/linux/compat-2.6.h b/backport/include/linux/compat-2.6.h
index 57a1c13..109afd4 100644
--- a/backport/include/linux/compat-2.6.h
+++ b/backport/include/linux/compat-2.6.h
@@ -18,6 +18,21 @@
 #include <linux/init.h>
 #include <linux/uidgid.h>
 
+#define backport_init_sym(fn) extern void backport_##fn(void);
+#define backport_init_call(fn) backport_##fn()
+
+#define backport_initcall(fn)			\
+	void backport_##fn(void)		\
+	{					\
+		fn();				\
+	}
+
+#undef core_initcall
+#undef late_initcall
+
+#define core_initcall	backport_initcall
+#define late_initcall	backport_initcall
+
 /*
  * The define overwriting module_init is based on the original module_init
  * which looks like this:
-- 
1.7.10.4


  reply	other threads:[~2013-04-07  2:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-07  2:35 [PATCH 0/3] backports: adds regulator and media susbsystems Luis R. Rodriguez
2013-04-07  2:35 ` Luis R. Rodriguez [this message]
2013-04-07  2:35 ` [PATCH 2/3] backports: add support for voltage / current regulator subsystem Luis R. Rodriguez
2013-04-07  2:35 ` [PATCH 3/3] backports: add media subsystem drivers Luis R. Rodriguez
2013-04-07  2:37 ` [PATCH 0/3] backports: adds regulator and media susbsystems Luis R. Rodriguez
2013-04-07 17:47   ` Luis R. Rodriguez

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=1365302138-19736-2-git-send-email-mcgrof@do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=backports@vger.kernel.org \
    --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®