From: "Robert P. J. Day" <rpjday@mindspring.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>
Subject: [PATCH] Clean up the contents of module.h and moduleparam.h.
Date: Mon, 21 May 2007 06:43:50 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0705210523180.30935@localhost.localdomain> (raw)
Shift the contents of module.h and moduleparam.h so that generic
module content is exclusively in module.h, while parameter-specific
content is in moduleparam.h.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
---
while this patch makes the contents of module.h and moduleparam.h
somewhat more organized, it still has the weird property that each of
those two files includes the other. given the current state of
includes throughout the source tree, there's not much that can be done
about that at the moment.
compile-tested with "make allmodconfig" on x86.
include/linux/module.h | 19 +++++++++++++------
include/linux/moduleparam.h | 16 +++++-----------
2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/include/linux/module.h b/include/linux/module.h
index e6e0f86..442d3bf 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -15,7 +15,7 @@
#include <linux/elf.h>
#include <linux/stringify.h>
#include <linux/kobject.h>
-#include <linux/moduleparam.h>
+#include <linux/moduleparam.h> /* In a perfect world, this wouldn't be here. */
#include <asm/local.h>
#include <asm/module.h>
@@ -88,6 +88,17 @@ extern struct module __this_module;
#define THIS_MODULE ((struct module *)0)
#endif
+#ifdef MODULE
+#define ___module_cat(a,b) __mod_ ## a ## b
+#define __module_cat(a,b) ___module_cat(a,b)
+#define __MODULE_INFO(tag, name, info) \
+static const char __module_cat(name,__LINE__)[] \
+ __maybe_unused \
+ __attribute__((section(".modinfo"))) = __stringify(tag) "=" info
+#else /* !MODULE */
+#define __MODULE_INFO(tag, name, info)
+#endif
+
/* Generic info of form tag = "info" */
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
@@ -130,11 +141,6 @@ extern struct module __this_module;
/* What your module does. */
#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
-/* One for each parameter, describing how to use it. Some files do
- multiple of these per line, so can't just use MODULE_INFO. */
-#define MODULE_PARM_DESC(_parm, desc) \
- __MODULE_INFO(parm, _parm, #_parm ":" desc)
-
#define MODULE_DEVICE_TABLE(type,name) \
MODULE_GENERIC_TABLE(type##_device,name)
@@ -576,6 +582,7 @@ struct device_driver;
struct module;
extern struct kset module_subsys;
+struct kernel_param;
int mod_sysfs_init(struct module *mod);
int mod_sysfs_setup(struct module *mod,
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index c83588c..e8f5960 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -4,6 +4,7 @@
#include <linux/init.h>
#include <linux/stringify.h>
#include <linux/kernel.h>
+#include <linux/module.h>
/* You can override this manually, but generally this should match the
module name. */
@@ -13,19 +14,12 @@
#define MODULE_PARAM_PREFIX KBUILD_MODNAME "."
#endif
-#ifdef MODULE
-#define ___module_cat(a,b) __mod_ ## a ## b
-#define __module_cat(a,b) ___module_cat(a,b)
-#define __MODULE_INFO(tag, name, info) \
-static const char __module_cat(name,__LINE__)[] \
- __attribute_used__ \
- __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
-#else /* !MODULE */
-#define __MODULE_INFO(tag, name, info)
-#endif
-#define __MODULE_PARM_TYPE(name, _type) \
+#define __MODULE_PARM_TYPE(name, _type) \
__MODULE_INFO(parmtype, name##type, #name ":" _type)
+#define MODULE_PARM_DESC(_parm, desc) \
+ __MODULE_INFO(parm, _parm, #_parm ":" desc)
+
struct kernel_param;
/* Returns 0, or -errno. arg is in kp->arg. */
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
next reply other threads:[~2007-05-21 10:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-21 10:43 Robert P. J. Day [this message]
2007-05-22 7:09 ` Andrew Morton
2007-05-22 7:55 ` Robert P. J. Day
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=Pine.LNX.4.64.0705210523180.30935@localhost.localdomain \
--to=rpjday@mindspring.com \
--cc=akpm@osdl.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®