mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Clean up the contents of module.h and moduleparam.h.
@ 2007-05-21 10:43 Robert P. J. Day
  2007-05-22  7:09 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Robert P. J. Day @ 2007-05-21 10:43 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Andrew Morton


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
========================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Clean up the contents of module.h and moduleparam.h.
  2007-05-21 10:43 [PATCH] Clean up the contents of module.h and moduleparam.h Robert P. J. Day
@ 2007-05-22  7:09 ` Andrew Morton
  2007-05-22  7:55   ` Robert P. J. Day
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-05-22  7:09 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

On Mon, 21 May 2007 06:43:50 -0400 (EDT) "Robert P. J. Day" <rpjday@mindspring.com> wrote:

> 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.
> 

Causes weird runtime errors with
http://userweb.kernel.org/~akpm/config-sony.txt

[    1.347665] speedstep-centrino with X86_SPEEDSTEP_CENTRINO_ACPI config is deprecated.
[    1.347667]  Use X86_ACPI_CPUFREQ (acpi-cpufreq) instead.
[    1.354537] Using IPI Shortcut mode
[    1.358936] Freeing unused kernel memory: 196k freed
[    1.401304] input: PS/2 Mouse as /class/input/input3
[    1.405223] input: AlpsPS/2 ALPS GlidePoint as /class/input/input4
[    1.417894] ide_core: no version magic, tainting kernel.
[    1.421081] ide_core: module license 'unspecified' taints kernel.
[    1.424279] ide_core: Unknown symbol bus_for_each_drv
[    1.427463] ide_core: Unknown symbol bus_unregister
[    1.430503] ide_core: Unknown symbol device_release_driver
[    1.433563] ide_core: Unknown symbol add_uevent_var
[    1.436637] ide_core: Unknown symbol device_register
[    1.439647] ide_core: Unknown symbol device_attach
[    1.442519] ide_core: Unknown symbol bus_register
[    1.445282] ide_core: Unknown symbol device_unregister
[    1.453848] ide_disk: no version magic, tainting kernel.
[    1.456626] ide_disk: Unknown symbol __ide_error
[    1.459374] ide_disk: Unknown symbol ide_raw_taskfile
[    1.462103] ide_disk: Unknown symbol task_in_intr
[    1.464745] ide_disk: Unknown symbol driver_unregister
[    1.467390] ide_disk: Unknown symbol ide_map_sg
[    1.470025] ide_disk: Unknown symbol driver_register
[    1.472591] ide_disk: Unknown symbol ide_proc_unregister_driver
[    1.475093] ide_disk: Unknown symbol ide_dma_verbose
[    1.477637] ide_disk: Unknown symbol ide_proc_register_driver
[    1.480171] ide_disk: Unknown symbol generic_ide_ioctl
[    1.482663] ide_disk: Unknown symbol __ide_abort
[    1.485082] ide_disk: Unknown symbol ide_init_drive_cmd
[    1.487539] ide_disk: Unknown symbol pre_task_out_intr
[    1.489932] ide_disk: Unknown symbol proc_ide_read_geometry
[    1.492299] ide_disk: Unknown symbol ide_do_drive_cmd
[    1.494618] ide_disk: Unknown symbol ide_init_disk
[    1.496901] ide_disk: Unknown symbol ide_bus_type
[    1.499200] ide_disk: Unknown symbol ide_execute_command
[    1.501420] ide_disk: Unknown symbol task_no_data_intr
[    1.503583] ide_disk: Unknown symbol ide_get_error_location
[    1.505738] ide_disk: Unknown symbol ide_end_request
[    1.507840] ide_disk: Unknown symbol ide_setting_mtx
[    1.509903] ide_disk: Unknown symbol ide_init_sg_cmd
[    1.511942] ide_disk: Unknown symbol ide_add_setting
[    1.513971] ide_disk: Unknown symbol ide_spin_wait_hwgroup
[    1.520499] jbd: no version magic, tainting kernel.
[    1.522855] jbd: Unknown symbol round_jiffies
[    1.529780] ext3: no version magic, tainting kernel.
[    1.532032] ext3: Unknown symbol journal_get_create_access
[    1.534214] ext3: Unknown symbol journal_stop
[    1.536375] ext3: Unknown symbol journal_get_write_access
[    1.538544] ext3: Unknown symbol journal_init_dev
[    1.540818] ext3: Unknown symbol journal_errno
[    1.542907] ext3: Unknown symbol journal_restart
[    1.544992] ext3: Unknown symbol journal_dirty_metadata
[    1.547143] ext3: Unknown symbol journal_try_to_free_buffers
[    1.549274] ext3: Unknown symbol journal_dirty_data
[    1.551401] ext3: Unknown symbol journal_release_buffer
[    1.553478] ext3: Unknown symbol journal_extend
[    1.555517] ext3: Unknown symbol journal_blocks_per_page
[    1.557528] ext3: Unknown symbol journal_forget
[    1.559459] ext3: Unknown symbol journal_force_commit
[    1.561347] ext3: Unknown symbol page_cache_readahead_ondemand
[    1.563286] ext3: Unknown symbol journal_get_undo_access
[    1.565287] ext3: Unknown symbol journal_clear_err
[    1.567240] ext3: Unknown symbol journal_start
[    1.569230] ext3: Unknown symbol log_wait_commit
[    1.571155] ext3: Unknown symbol journal_abort
[    1.573058] ext3: Unknown symbol journal_check_available_features
[    1.575063] ext3: Unknown symbol journal_init_inode
[    1.576983] ext3: Unknown symbol journal_unlock_updates
[    1.578900] ext3: Unknown symbol journal_force_commit_nested
[    1.580813] ext3: Unknown symbol journal_flush
[    1.582738] ext3: Unknown symbol journal_wipe
[    1.584680] ext3: Unknown symbol journal_load
[    1.586538] ext3: Unknown symbol journal_start_commit
[    1.588416] ext3: Unknown symbol journal_destroy
[    1.590365] ext3: Unknown symbol journal_update_format
[    1.592197] ext3: Unknown symbol journal_revoke
[    1.594021] ext3: Unknown symbol journal_create
[    1.595863] ext3: Unknown symbol journal_lock_updates
[    1.597710] ext3: Unknown symbol journal_invalidatepage
[    1.645951] Kernel panic - not syncing: Attempted to kill init!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Clean up the contents of module.h and moduleparam.h.
  2007-05-22  7:09 ` Andrew Morton
@ 2007-05-22  7:55   ` Robert P. J. Day
  0 siblings, 0 replies; 3+ messages in thread
From: Robert P. J. Day @ 2007-05-22  7:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List

On Tue, 22 May 2007, Andrew Morton wrote:

> On Mon, 21 May 2007 06:43:50 -0400 (EDT) "Robert P. J. Day" <rpjday@mindspring.com> wrote:
>
> > 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.
> >
>
> Causes weird runtime errors with
> http://userweb.kernel.org/~akpm/config-sony.txt
>
> [    1.347665] speedstep-centrino with X86_SPEEDSTEP_CENTRINO_ACPI config is deprecated.
> [    1.347667]  Use X86_ACPI_CPUFREQ (acpi-cpufreq) instead.
> [    1.354537] Using IPI Shortcut mode
> [    1.358936] Freeing unused kernel memory: 196k freed
> [    1.401304] input: PS/2 Mouse as /class/input/input3
> [    1.405223] input: AlpsPS/2 ALPS GlidePoint as /class/input/input4
> [    1.417894] ide_core: no version magic, tainting kernel.
> [    1.421081] ide_core: module license 'unspecified' taints kernel.
> [    1.424279] ide_core: Unknown symbol bus_for_each_drv
> [    1.427463] ide_core: Unknown symbol bus_unregister
> [    1.430503] ide_core: Unknown symbol device_release_driver
> [    1.433563] ide_core: Unknown symbol add_uevent_var
> [    1.436637] ide_core: Unknown symbol device_register
> [    1.439647] ide_core: Unknown symbol device_attach
> [    1.442519] ide_core: Unknown symbol bus_register
> [    1.445282] ide_core: Unknown symbol device_unregister
> [    1.453848] ide_disk: no version magic, tainting kernel.
> [    1.456626] ide_disk: Unknown symbol __ide_error
> [    1.459374] ide_disk: Unknown symbol ide_raw_taskfile
> [    1.462103] ide_disk: Unknown symbol task_in_intr
> [    1.464745] ide_disk: Unknown symbol driver_unregister
> [    1.467390] ide_disk: Unknown symbol ide_map_sg
... snip ...
> [    1.645951] Kernel panic - not syncing: Attempted to kill init!

ok, that's just weird, since that patch should *theoretically* not
have made any difference in the long run -- any errors in the patch
should have shown up in the build.

i'll look at this closer.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-22  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-21 10:43 [PATCH] Clean up the contents of module.h and moduleparam.h Robert P. J. Day
2007-05-22  7:09 ` Andrew Morton
2007-05-22  7:55   ` Robert P. J. Day

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®