Skip to contentSkip to conversation

x86: remove modular references from non modular code

PATCH In review Paul Gortmaker 3 participants 13 messages Feb 14, 2016 – Feb 16, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover x86: remove modular references from non modular code

My audit of i386 allmodconfig found these instances of non-modular code needlessly using the modular equivalents of their built-in counterparts.

In fixing that, we get rid of some dead code, make the mandate of the remaining code more clear, and leave behind better examples for future platform code to copy/emulate.

Several of them are trivial, in that there is no binary output change. A couple others have dead code removal so the binary
output will be slightly smaller. We've done a direct mapping
of module_init --> device_initcall in each instance, so there is no initcall reordering risks here. Overall, in all cases, the runtime should be completely unchanged.

Where others have deployed module_param() already, we have to leave it, because there is no equivalent builtin_param (not yet) and we have to remain compatible with existing bootarg users.

Paul.
---

Cc Bryan O'Donoghue <[email protected]>
Cc Ed Wildgoose <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Philip Prindeville <[email protected]>
Cc Thomas Gleixner <[email protected]>

Paul Gortmaker (5):
x86: make platform/intel-quark/imr.c explicitly non-modular
x86: make platform/intel-quark/imr_selftest.c explicitly non-modular
x86: make platform/geode/geos.c explicitly non-modular
x86: make platform/geode/alix.c explicitly non-modular
x86: make platform/geode/net5501.c explicitly non-modular

 arch/x86/platform/geode/alix.c               | 14 +++++------
 arch/x86/platform/geode/geos.c               |  8 +------
 arch/x86/platform/geode/net5501.c            |  8 +------
 arch/x86/platform/intel-quark/imr.c          | 35 ++--------------------------
 arch/x86/platform/intel-quark/imr_selftest.c | 15 ++----------
 5 files changed, 13 insertions(+), 67 deletions(-)
Signature · 1 line
2.6.1
#1 lore raw

PATCH 1/5 x86: make platform/intel-quark/imr.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_IMR
drivers/platform/x86/Kconfig: bool "Intel Isolated Memory Region support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Bryan O'Donoghue <[email protected]>
---
 arch/x86/platform/intel-quark/imr.c | 35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)
arch/x86/platform/intel-quark/imr.c +2 -33
index c61b6c332e97..0a3736f03edc 100644
@@ -1,5 +1,5 @@
 /**
- * imr.c
+ * imr.c -- Intel Isolated Memory Region driver
  *
  * Copyright(c) 2013 Intel Corporation.
  * Copyright(c) 2015 Bryan O'Donoghue <[email protected]>
@@ -31,7 +31,6 @@
 #include <linux/debugfs.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/module.h>
 #include <linux/types.h>
 
 struct imr_device {
@@ -270,17 +269,6 @@ static int imr_debugfs_register(struct imr_device *idev)
 }
 
 /**
- * imr_debugfs_unregister - unregister debugfs hooks.
- *
- * @idev:	pointer to imr_device structure.
- * @return:
- */
-static void imr_debugfs_unregister(struct imr_device *idev)
-{
-	debugfs_remove(idev->file);
-}
-
-/**
  * imr_check_params - check passed address range IMR alignment and non-zero size
  *
  * @base:	base address of intended IMR.
@@ -614,7 +602,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
 	{ X86_VENDOR_INTEL, 5, 9 },	/* Intel Quark SoC X1000. */
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, imr_ids);
 
 /**
  * imr_init - entry point for IMR driver.
@@ -640,22 +627,4 @@ static int __init imr_init(void)
 	imr_fixup_memmap(idev);
 	return 0;
 }
-
-/**
- * imr_exit - exit point for IMR code.
- *
- * Deregisters debugfs, leave IMR state as-is.
- *
- * return:
- */
-static void __exit imr_exit(void)
-{
-	imr_debugfs_unregister(&imr_dev);
-}
-
-module_init(imr_init);
-module_exit(imr_exit);
-
-MODULE_AUTHOR("Bryan O'Donoghue <[email protected]>");
-MODULE_DESCRIPTION("Intel Isolated Memory Region driver");
-MODULE_LICENSE("Dual BSD/GPL");
+device_initcall(imr_init);
Signature · 1 line
2.6.1
Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] x86: make platform/intel-quark/imr.c explicitly non-modular

Quoted 95 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_IMR
drivers/platform/x86/Kconfig: bool "Intel Isolated Memory Region
support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Bryan O'Donoghue <[email protected]>
---
 arch/x86/platform/intel-quark/imr.c | 35 ++-------------------------
--------
 1 file changed, 2 insertions(+), 33 deletions(-)
arch/x86/platform/intel-quark/imr.c +1 -13
index c61b6c332e97..0a3736f03edc 100644
@@ -1,5 +1,5 @@
 /**
- * imr.c
+ * imr.c -- Intel Isolated Memory Region driver
  *
  * Copyright(c) 2013 Intel Corporation.
  * Copyright(c) 2015 Bryan O'Donoghue <[email protected]>
@@ -31,7 +31,6 @@
 #include <linux/debugfs.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/module.h>
 #include <linux/types.h>
 
 struct imr_device {
@@ -270,17 +269,6 @@ static int imr_debugfs_register(struct
 imr_device *idev)
 }
 
 /**
- * imr_debugfs_unregister - unregister debugfs hooks.
- *
- * @idev:	pointer to imr_device structure.
- * @return:
- */
-static void imr_debugfs_unregister(struct imr_device *idev)
-{
-	debugfs_remove(idev->file);
-}
-
-/**
  * imr_check_params - check passed address range IMR alignment and

non-zero size
*
* @base: base address of intended IMR.

arch/x86/platform/intel-quark/imr.c +0 -1
@@ -614,7 +602,6 @@ static const struct x86_cpu_id imr_ids[]
 __initconst = {
 	{ X86_VENDOR_INTEL, 5, 9 },	/* Intel Quark SoC X1000.
 */
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, imr_ids);
 

/**
* imr_init - entry point for IMR driver.

arch/x86/platform/intel-quark/imr.c +0 -10
@@ -640,22 +627,4 @@ static int __init imr_init(void)
 	imr_fixup_memmap(idev);
 	return 0;
 }
-
-/**
- * imr_exit - exit point for IMR code.
- *
- * Deregisters debugfs, leave IMR state as-is.
- *
- * return:
- */
-static void __exit imr_exit(void)
-{

arch/x86/platform/intel-quark/imr.c static int __init imr_init(void) · line 630

Quoted 10 lines
arch/x86/platform/intel-quark/imr.c +1 -9
-	imr_debugfs_unregister(&imr_dev);
-}
-
-module_init(imr_init);
-module_exit(imr_exit);
-
-MODULE_AUTHOR("Bryan O'Donoghue <[email protected]>");
-MODULE_DESCRIPTION("Intel Isolated Memory Region driver");
-MODULE_LICENSE("Dual BSD/GPL");
+device_initcall(imr_init);

Fine by me.

#3 lore raw

[tip:x86/platform] x86/platform: Make platform/intel-quark/ imr.c explicitly non-modular

In reply to Paul Gortmaker
x86/platform: Make platform/intel-quark/imr.c explicitly non-modular
Commit-ID:  7f5301b7e66a1fd096b5d10dbb0bb2a8832516b4
Gitweb:     http://git.kernel.org/tip/7f5301b7e66a1fd096b5d10dbb0bb2a8832516b4
Author:     Paul Gortmaker <[email protected]>
AuthorDate: Sun, 14 Feb 2016 18:09:52 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 16 Feb 2016 09:11:08 +0100

x86/platform: Make platform/intel-quark/imr.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_IMR
drivers/platform/x86/Kconfig: bool "Intel Isolated Memory Region support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

---
 arch/x86/platform/intel-quark/imr.c | 35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)
arch/x86/platform/intel-quark/imr.c +2 -33
index c61b6c3..0a3736f 100644
@@ -1,5 +1,5 @@
 /**
- * imr.c
+ * imr.c -- Intel Isolated Memory Region driver
  *
  * Copyright(c) 2013 Intel Corporation.
  * Copyright(c) 2015 Bryan O'Donoghue <[email protected]>
@@ -31,7 +31,6 @@
 #include <linux/debugfs.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/module.h>
 #include <linux/types.h>
 
 struct imr_device {
@@ -270,17 +269,6 @@ static int imr_debugfs_register(struct imr_device *idev)
 }
 
 /**
- * imr_debugfs_unregister - unregister debugfs hooks.
- *
- * @idev:	pointer to imr_device structure.
- * @return:
- */
-static void imr_debugfs_unregister(struct imr_device *idev)
-{
-	debugfs_remove(idev->file);
-}
-
-/**
  * imr_check_params - check passed address range IMR alignment and non-zero size
  *
  * @base:	base address of intended IMR.
@@ -614,7 +602,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
 	{ X86_VENDOR_INTEL, 5, 9 },	/* Intel Quark SoC X1000. */
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, imr_ids);
 
 /**
  * imr_init - entry point for IMR driver.
@@ -640,22 +627,4 @@ static int __init imr_init(void)
 	imr_fixup_memmap(idev);
 	return 0;
 }
-
-/**
- * imr_exit - exit point for IMR code.
- *
- * Deregisters debugfs, leave IMR state as-is.
- *
- * return:
- */
-static void __exit imr_exit(void)
-{
-	imr_debugfs_unregister(&imr_dev);
-}
-
-module_init(imr_init);
-module_exit(imr_exit);
-
-MODULE_AUTHOR("Bryan O'Donoghue <[email protected]>");
-MODULE_DESCRIPTION("Intel Isolated Memory Region driver");
-MODULE_LICENSE("Dual BSD/GPL");
+device_initcall(imr_init);
#4 lore raw

PATCH 3/5 x86: make platform/geode/geos.c explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig:config GEOS
arch/x86/Kconfig: bool "Traverse Technologies GEOS System Support (LEDS, GPIO, etc)"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity, so that when reading the code there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Philip Prindeville <[email protected]>
---
 arch/x86/platform/geode/geos.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
arch/x86/platform/geode/geos.c +1 -7
index aa733fba2471..4fcdb91318a0 100644
@@ -19,7 +19,6 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/string.h>
-#include <linux/module.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
@@ -120,9 +119,4 @@ static int __init geos_init(void)
 
 	return 0;
 }
-
-module_init(geos_init);
-
-MODULE_AUTHOR("Philip Prindeville <[email protected]>");
-MODULE_DESCRIPTION("Traverse Technologies Geos System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(geos_init);
Signature · 1 line
2.6.1
#5 lore raw

[tip:x86/platform] x86/platform: Make platform/geode/ geos.c explicitly non-modular

x86/platform: Make platform/geode/geos.c explicitly non-modular
Commit-ID:  eb61aee743ec647f22071479a5137241a7dcab17
Gitweb:     http://git.kernel.org/tip/eb61aee743ec647f22071479a5137241a7dcab17
Author:     Paul Gortmaker <[email protected]>
AuthorDate: Sun, 14 Feb 2016 18:09:54 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 16 Feb 2016 09:11:09 +0100

x86/platform: Make platform/geode/geos.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig:config GEOS
arch/x86/Kconfig: bool "Traverse Technologies GEOS System Support (LEDS, GPIO, etc)"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity, so that when reading the code there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

---
 arch/x86/platform/geode/geos.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
arch/x86/platform/geode/geos.c +1 -7
index aa733fb..4fcdb91 100644
@@ -19,7 +19,6 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/string.h>
-#include <linux/module.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
@@ -120,9 +119,4 @@ static int __init geos_init(void)
 
 	return 0;
 }
-
-module_init(geos_init);
-
-MODULE_AUTHOR("Philip Prindeville <[email protected]>");
-MODULE_DESCRIPTION("Traverse Technologies Geos System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(geos_init);
#6 lore raw

PATCH 4/5 x86: make platform/geode/alix.c explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig:config ALIX
arch/x86/Kconfig: bool "PCEngines ALIX System Support (LED setup)"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

We replace module.h with moduleparam.h since the file does declare some module parameters, and leaving them as such is currently the easiest way to remain compatible with existing boot arg use cases.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ed Wildgoose <[email protected]>
---
 arch/x86/platform/geode/alix.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/x86/platform/geode/alix.c +7 -7
index 76b6632d3143..1865c196f136 100644
@@ -21,7 +21,7 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/string.h>
-#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
@@ -35,6 +35,11 @@
 #define BIOS_SIGNATURE_COREBOOT		0x500
 #define BIOS_REGION_SIZE		0x10000
 
+/*
+ * This driver is not modular, but to keep back compatibility
+ * with existing use cases, continuing with module_param is
+ * the easiest way forward.
+ */
 static bool force = 0;
 module_param(force, bool, 0444);
 /* FIXME: Award bios is not automatically detected as Alix platform */
@@ -192,9 +197,4 @@ static int __init alix_init(void)
 
 	return 0;
 }
-
-module_init(alix_init);
-
-MODULE_AUTHOR("Ed Wildgoose <[email protected]>");
-MODULE_DESCRIPTION("PCEngines ALIX System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(alix_init);
Signature · 1 line
2.6.1
#7 lore raw

[tip:x86/platform] x86/platform: Make platform/geode/ alix.c explicitly non-modular

x86/platform: Make platform/geode/alix.c explicitly non-modular
Commit-ID:  52d856e88171e1ec000d0479363c1e4e81991130
Gitweb:     http://git.kernel.org/tip/52d856e88171e1ec000d0479363c1e4e81991130
Author:     Paul Gortmaker <[email protected]>
AuthorDate: Sun, 14 Feb 2016 18:09:55 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 16 Feb 2016 09:11:09 +0100

x86/platform: Make platform/geode/alix.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig:config ALIX
arch/x86/Kconfig: bool "PCEngines ALIX System Support (LED setup)"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

We replace module.h with moduleparam.h since the file does declare some module parameters, and leaving them as such is currently the easiest way to remain compatible with existing boot arg use cases.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

---
 arch/x86/platform/geode/alix.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/x86/platform/geode/alix.c +7 -7
index 76b6632..1865c19 100644
@@ -21,7 +21,7 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/string.h>
-#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
@@ -35,6 +35,11 @@
 #define BIOS_SIGNATURE_COREBOOT		0x500
 #define BIOS_REGION_SIZE		0x10000
 
+/*
+ * This driver is not modular, but to keep back compatibility
+ * with existing use cases, continuing with module_param is
+ * the easiest way forward.
+ */
 static bool force = 0;
 module_param(force, bool, 0444);
 /* FIXME: Award bios is not automatically detected as Alix platform */
@@ -192,9 +197,4 @@ static int __init alix_init(void)
 
 	return 0;
 }
-
-module_init(alix_init);
-
-MODULE_AUTHOR("Ed Wildgoose <[email protected]>");
-MODULE_DESCRIPTION("PCEngines ALIX System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(alix_init);
#8 lore raw

PATCH 1/1 x86: make platform/intel-quark/imr_selftest.c explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig.debug:config DEBUG_IMR_SELFTEST
arch/x86/Kconfig.debug: bool "Isolated Memory Region self test"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Bryan O'Donoghue <[email protected]>
---
 arch/x86/platform/intel-quark/imr_selftest.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
arch/x86/platform/intel-quark/imr_selftest.c +2 -13
index 278e4da4222f..0381343a0d3a 100644
@@ -1,5 +1,5 @@
 /**
- * imr_selftest.c
+ * imr_selftest.c -- Intel Isolated Memory Region self-test driver
  *
  * Copyright(c) 2013 Intel Corporation.
  * Copyright(c) 2015 Bryan O'Donoghue <[email protected]>
@@ -15,7 +15,6 @@
 #include <asm/imr.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/module.h>
 #include <linux/types.h>
 
 #define SELFTEST KBUILD_MODNAME ": "
@@ -106,7 +105,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
 	{ X86_VENDOR_INTEL, 5, 9 },	/* Intel Quark SoC X1000. */
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, imr_ids);
 
 /**
  * imr_self_test_init - entry point for IMR driver.
@@ -125,13 +123,4 @@ static int __init imr_self_test_init(void)
  *
  * return:
  */
-static void __exit imr_self_test_exit(void)
-{
-}
-
-module_init(imr_self_test_init);
-module_exit(imr_self_test_exit);
-
-MODULE_AUTHOR("Bryan O'Donoghue <[email protected]>");
-MODULE_DESCRIPTION("Intel Isolated Memory Region self-test driver");
-MODULE_LICENSE("Dual BSD/GPL");
+device_initcall(imr_self_test_init);
Signature · 1 line
2.6.1
Reviewed-by on v1 1/1
#9 lore raw

Re: [PATCH] x86: make platform/intel-quark/imr_selftest.c explicitly non-modular

Quoted 64 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig.debug:config DEBUG_IMR_SELFTEST
arch/x86/Kconfig.debug: bool "Isolated Memory Region self test"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Bryan O'Donoghue <[email protected]>
---
 arch/x86/platform/intel-quark/imr_selftest.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
arch/x86/platform/intel-quark/imr_selftest.c +1 -3
index 278e4da4222f..0381343a0d3a 100644
@@ -1,5 +1,5 @@
 /**
- * imr_selftest.c
+ * imr_selftest.c -- Intel Isolated Memory Region self-test driver
  *
  * Copyright(c) 2013 Intel Corporation.
  * Copyright(c) 2015 Bryan O'Donoghue <[email protected]>
@@ -15,7 +15,6 @@
 #include <asm/imr.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/module.h>
 #include <linux/types.h>
 
 #define SELFTEST KBUILD_MODNAME ": "
@@ -106,7 +105,6 @@ static const struct x86_cpu_id imr_ids[]
 __initconst = {
 	{ X86_VENDOR_INTEL, 5, 9 },	/* Intel Quark SoC X1000.
 */
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, imr_ids);
 

/**
* imr_self_test_init - entry point for IMR driver.

arch/x86/platform/intel-quark/imr_selftest.c +0 -1
@@ -125,13 +123,4 @@ static int __init imr_self_test_init(void)
  *
  * return:
  */
-static void __exit imr_self_test_exit(void)

arch/x86/platform/intel-quark/imr_selftest.c static int __init imr_self_test_init(void) · line 126

Quoted 10 lines
arch/x86/platform/intel-quark/imr_selftest.c +1 -9
-{
-}
-
-module_init(imr_self_test_init);
-module_exit(imr_self_test_exit);
-
-MODULE_AUTHOR("Bryan O'Donoghue <[email protected]>");
-MODULE_DESCRIPTION("Intel Isolated Memory Region self-test driver");
-MODULE_LICENSE("Dual BSD/GPL");
+device_initcall(imr_self_test_init);

Fine by me.

#10 lore raw

[tip:x86/platform] x86/platform: Make platform/intel-quark/ imr_selftest.c explicitly non-modular

In reply to Paul Gortmaker
x86/platform: Make platform/intel-quark/imr_selftest.c explicitly non-modular
Commit-ID:  32ed42ad6c42d6e0e78914a25c216fbbd595e74d
Gitweb:     http://git.kernel.org/tip/32ed42ad6c42d6e0e78914a25c216fbbd595e74d
Author:     Paul Gortmaker <[email protected]>
AuthorDate: Sun, 14 Feb 2016 18:09:53 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 16 Feb 2016 09:11:08 +0100

x86/platform: Make platform/intel-quark/imr_selftest.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig.debug:config DEBUG_IMR_SELFTEST
arch/x86/Kconfig.debug: bool "Isolated Memory Region self test"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

---
 arch/x86/platform/intel-quark/imr_selftest.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
arch/x86/platform/intel-quark/imr_selftest.c +2 -13
index 278e4da..0381343 100644
@@ -1,5 +1,5 @@
 /**
- * imr_selftest.c
+ * imr_selftest.c -- Intel Isolated Memory Region self-test driver
  *
  * Copyright(c) 2013 Intel Corporation.
  * Copyright(c) 2015 Bryan O'Donoghue <[email protected]>
@@ -15,7 +15,6 @@
 #include <asm/imr.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/module.h>
 #include <linux/types.h>
 
 #define SELFTEST KBUILD_MODNAME ": "
@@ -106,7 +105,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
 	{ X86_VENDOR_INTEL, 5, 9 },	/* Intel Quark SoC X1000. */
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, imr_ids);
 
 /**
  * imr_self_test_init - entry point for IMR driver.
@@ -125,13 +123,4 @@ static int __init imr_self_test_init(void)
  *
  * return:
  */
-static void __exit imr_self_test_exit(void)
-{
-}
-
-module_init(imr_self_test_init);
-module_exit(imr_self_test_exit);
-
-MODULE_AUTHOR("Bryan O'Donoghue <[email protected]>");
-MODULE_DESCRIPTION("Intel Isolated Memory Region self-test driver");
-MODULE_LICENSE("Dual BSD/GPL");
+device_initcall(imr_self_test_init);
#11 lore raw

PATCH 5/5 x86: make platform/geode/net5501.c explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig:config NET5501
arch/x86/Kconfig: bool "Soekris Engineering net5501 System Support (LEDS, GPIO, etc)"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Philip Prindeville <[email protected]>
---
 arch/x86/platform/geode/net5501.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
arch/x86/platform/geode/net5501.c +1 -7
index 927e38c0089f..a2f6b982a729 100644
@@ -20,7 +20,6 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/string.h>
-#include <linux/module.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
@@ -146,9 +145,4 @@ static int __init net5501_init(void)
 
 	return 0;
 }
-
-module_init(net5501_init);
-
-MODULE_AUTHOR("Philip Prindeville <[email protected]>");
-MODULE_DESCRIPTION("Soekris net5501 System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(net5501_init);
Signature · 1 line
2.6.1
#12 lore raw

[tip:x86/platform] x86/platform: Make platform/geode/ net5501.c explicitly non-modular

x86/platform: Make platform/geode/net5501.c explicitly non-modular
Commit-ID:  605a46ee8353e8292e93baa5dc13e6be98bbec43
Gitweb:     http://git.kernel.org/tip/605a46ee8353e8292e93baa5dc13e6be98bbec43
Author:     Paul Gortmaker <[email protected]>
AuthorDate: Sun, 14 Feb 2016 18:09:56 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 16 Feb 2016 09:11:09 +0100

x86/platform: Make platform/geode/net5501.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

arch/x86/Kconfig:config NET5501
arch/x86/Kconfig: bool "Soekris Engineering net5501 System Support (LEDS, GPIO, etc)"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity, so that when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

---
 arch/x86/platform/geode/net5501.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
arch/x86/platform/geode/net5501.c +1 -7
index 927e38c..a2f6b98 100644
@@ -20,7 +20,6 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/string.h>
-#include <linux/module.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
@@ -146,9 +145,4 @@ static int __init net5501_init(void)
 
 	return 0;
 }
-
-module_init(net5501_init);
-
-MODULE_AUTHOR("Philip Prindeville <[email protected]>");
-MODULE_DESCRIPTION("Soekris net5501 System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(net5501_init);