Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1333752 > unrolled thread

[PATCH 0/5] x86: remove modular references from non modular code

Started byPaul Gortmaker <paul.gortmaker@windriver.com>
First post2016-02-15 00:20 +0100
Last post2016-02-16 13:20 +0100
Articles 10 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/5] x86: remove modular references from non modular code Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-15 00:20 +0100
    [PATCH 4/5] x86: make platform/geode/alix.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-15 00:20 +0100
      [tip:x86/platform] x86/platform: Make platform/geode/  alix.c explicitly non-modular tip-bot for Paul Gortmaker <tipbot@zytor.com> - 2016-02-16 13:20 +0100
    [PATCH 3/5] x86: make platform/geode/geos.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-15 00:20 +0100
      [tip:x86/platform] x86/platform: Make platform/geode/  geos.c explicitly non-modular tip-bot for Paul Gortmaker <tipbot@zytor.com> - 2016-02-16 13:20 +0100
    [PATCH 1/5] x86: make platform/intel-quark/imr.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-15 00:20 +0100
      Re: [PATCH 1/5] x86: make platform/intel-quark/imr.c explicitly  non-modular Bryan O'Donoghue <pure.logic@nexus-software.ie> - 2016-02-15 10:30 +0100
      [tip:x86/platform] x86/platform: Make platform/intel-quark/  imr.c explicitly non-modular tip-bot for Paul Gortmaker <tipbot@zytor.com> - 2016-02-16 13:20 +0100
    [PATCH 5/5] x86: make platform/geode/net5501.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-15 00:20 +0100
      [tip:x86/platform] x86/platform: Make platform/geode/  net5501.c explicitly non-modular tip-bot for Paul Gortmaker <tipbot@zytor.com> - 2016-02-16 13:20 +0100

#1333752 — [PATCH 0/5] x86: remove modular references from non modular code

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-02-15 00:20 +0100
Subject[PATCH 0/5] x86: remove modular references from non modular code
Message-ID<r2e7o-154-7@gated-at.bofh.it>
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 <pure.logic@nexus-software.ie>
Cc: Ed Wildgoose <kernel@wildgooses.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Philip Prindeville <philipp@redfish-solutions.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org

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(-)

-- 
2.6.1

[toc] | [next] | [standalone]


#1333765 — [PATCH 4/5] x86: make platform/geode/alix.c explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-02-15 00:20 +0100
Subject[PATCH 4/5] x86: make platform/geode/alix.c explicitly non-modular
Message-ID<r2e7p-154-41@gated-at.bofh.it>
In reply to#1333752
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 <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ed Wildgoose <kernel@wildgooses.com>
Cc: x86@kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 arch/x86/platform/geode/alix.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/platform/geode/alix.c b/arch/x86/platform/geode/alix.c
index 76b6632d3143..1865c196f136 100644
--- a/arch/x86/platform/geode/alix.c
+++ b/arch/x86/platform/geode/alix.c
@@ -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 <kernel@wildgooses.com>");
-MODULE_DESCRIPTION("PCEngines ALIX System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(alix_init);
-- 
2.6.1

[toc] | [prev] | [next] | [standalone]


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

Fromtip-bot for Paul Gortmaker <tipbot@zytor.com>
Date2016-02-16 13:20 +0100
Subject[tip:x86/platform] x86/platform: Make platform/geode/ alix.c explicitly non-modular
Message-ID<r2MLM-7HT-9@gated-at.bofh.it>
In reply to#1333765
Commit-ID:  52d856e88171e1ec000d0479363c1e4e81991130
Gitweb:     http://git.kernel.org/tip/52d856e88171e1ec000d0479363c1e4e81991130
Author:     Paul Gortmaker <paul.gortmaker@windriver.com>
AuthorDate: Sun, 14 Feb 2016 18:09:55 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
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.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Ed Wildgoose <kernel@wildgooses.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1455491396-30977-5-git-send-email-paul.gortmaker@windriver.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/geode/alix.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/platform/geode/alix.c b/arch/x86/platform/geode/alix.c
index 76b6632..1865c19 100644
--- a/arch/x86/platform/geode/alix.c
+++ b/arch/x86/platform/geode/alix.c
@@ -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 <kernel@wildgooses.com>");
-MODULE_DESCRIPTION("PCEngines ALIX System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(alix_init);

[toc] | [prev] | [next] | [standalone]


#1333767 — [PATCH 3/5] x86: make platform/geode/geos.c explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-02-15 00:20 +0100
Subject[PATCH 3/5] x86: make platform/geode/geos.c explicitly non-modular
Message-ID<r2e7p-154-51@gated-at.bofh.it>
In reply to#1333752
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 <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Philip Prindeville <philipp@redfish-solutions.com>
Cc: x86@kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 arch/x86/platform/geode/geos.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/x86/platform/geode/geos.c b/arch/x86/platform/geode/geos.c
index aa733fba2471..4fcdb91318a0 100644
--- a/arch/x86/platform/geode/geos.c
+++ b/arch/x86/platform/geode/geos.c
@@ -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 <philipp@redfish-solutions.com>");
-MODULE_DESCRIPTION("Traverse Technologies Geos System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(geos_init);
-- 
2.6.1

[toc] | [prev] | [next] | [standalone]


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

Fromtip-bot for Paul Gortmaker <tipbot@zytor.com>
Date2016-02-16 13:20 +0100
Subject[tip:x86/platform] x86/platform: Make platform/geode/ geos.c explicitly non-modular
Message-ID<r2MLN-7HT-27@gated-at.bofh.it>
In reply to#1333767
Commit-ID:  eb61aee743ec647f22071479a5137241a7dcab17
Gitweb:     http://git.kernel.org/tip/eb61aee743ec647f22071479a5137241a7dcab17
Author:     Paul Gortmaker <paul.gortmaker@windriver.com>
AuthorDate: Sun, 14 Feb 2016 18:09:54 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
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.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Philip Prindeville <philipp@redfish-solutions.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1455491396-30977-4-git-send-email-paul.gortmaker@windriver.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/geode/geos.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/x86/platform/geode/geos.c b/arch/x86/platform/geode/geos.c
index aa733fb..4fcdb91 100644
--- a/arch/x86/platform/geode/geos.c
+++ b/arch/x86/platform/geode/geos.c
@@ -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 <philipp@redfish-solutions.com>");
-MODULE_DESCRIPTION("Traverse Technologies Geos System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(geos_init);

[toc] | [prev] | [next] | [standalone]


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

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-02-15 00:20 +0100
Subject[PATCH 1/5] x86: make platform/intel-quark/imr.c explicitly non-modular
Message-ID<r2e7q-154-57@gated-at.bofh.it>
In reply to#1333752
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 <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Cc: x86@kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 arch/x86/platform/intel-quark/imr.c | 35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)

diff --git a/arch/x86/platform/intel-quark/imr.c b/arch/x86/platform/intel-quark/imr.c
index c61b6c332e97..0a3736f03edc 100644
--- a/arch/x86/platform/intel-quark/imr.c
+++ b/arch/x86/platform/intel-quark/imr.c
@@ -1,5 +1,5 @@
 /**
- * imr.c
+ * imr.c -- Intel Isolated Memory Region driver
  *
  * Copyright(c) 2013 Intel Corporation.
  * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie>
@@ -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 <pure.logic@nexus-software.ie>");
-MODULE_DESCRIPTION("Intel Isolated Memory Region driver");
-MODULE_LICENSE("Dual BSD/GPL");
+device_initcall(imr_init);
-- 
2.6.1

[toc] | [prev] | [next] | [standalone]


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

FromBryan O'Donoghue <pure.logic@nexus-software.ie>
Date2016-02-15 10:30 +0100
SubjectRe: [PATCH 1/5] x86: make platform/intel-quark/imr.c explicitly non-modular
Message-ID<r2nDI-7od-23@gated-at.bofh.it>
In reply to#1333770
On Sun, 2016-02-14 at 18:09 -0500, Paul Gortmaker wrote:
> 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 <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie>
> Cc: x86@kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  arch/x86/platform/intel-quark/imr.c | 35 ++-------------------------
> --------
>  1 file changed, 2 insertions(+), 33 deletions(-)
> 
> diff --git a/arch/x86/platform/intel-quark/imr.c
> b/arch/x86/platform/intel-quark/imr.c
> index c61b6c332e97..0a3736f03edc 100644
> --- a/arch/x86/platform/intel-quark/imr.c
> +++ b/arch/x86/platform/intel-quark/imr.c
> @@ -1,5 +1,5 @@
>  /**
> - * imr.c
> + * imr.c -- Intel Isolated Memory Region driver
>   *
>   * Copyright(c) 2013 Intel Corporation.
>   * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie>
> @@ -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 <pure.logic@nexus-software.ie>");
> -MODULE_DESCRIPTION("Intel Isolated Memory Region driver");
> -MODULE_LICENSE("Dual BSD/GPL");
> +device_initcall(imr_init);

Fine by me.
Reviewed-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>

[toc] | [prev] | [next] | [standalone]


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

Fromtip-bot for Paul Gortmaker <tipbot@zytor.com>
Date2016-02-16 13:20 +0100
Subject[tip:x86/platform] x86/platform: Make platform/intel-quark/ imr.c explicitly non-modular
Message-ID<r2MLM-7HT-17@gated-at.bofh.it>
In reply to#1333770
Commit-ID:  7f5301b7e66a1fd096b5d10dbb0bb2a8832516b4
Gitweb:     http://git.kernel.org/tip/7f5301b7e66a1fd096b5d10dbb0bb2a8832516b4
Author:     Paul Gortmaker <paul.gortmaker@windriver.com>
AuthorDate: Sun, 14 Feb 2016 18:09:52 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
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.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Reviewed-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1455491396-30977-2-git-send-email-paul.gortmaker@windriver.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/intel-quark/imr.c | 35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)

diff --git a/arch/x86/platform/intel-quark/imr.c b/arch/x86/platform/intel-quark/imr.c
index c61b6c3..0a3736f 100644
--- a/arch/x86/platform/intel-quark/imr.c
+++ b/arch/x86/platform/intel-quark/imr.c
@@ -1,5 +1,5 @@
 /**
- * imr.c
+ * imr.c -- Intel Isolated Memory Region driver
  *
  * Copyright(c) 2013 Intel Corporation.
  * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie>
@@ -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 <pure.logic@nexus-software.ie>");
-MODULE_DESCRIPTION("Intel Isolated Memory Region driver");
-MODULE_LICENSE("Dual BSD/GPL");
+device_initcall(imr_init);

[toc] | [prev] | [next] | [standalone]


#1333772 — [PATCH 5/5] x86: make platform/geode/net5501.c explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-02-15 00:20 +0100
Subject[PATCH 5/5] x86: make platform/geode/net5501.c explicitly non-modular
Message-ID<r2e7q-154-61@gated-at.bofh.it>
In reply to#1333752
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 <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Philip Prindeville <philipp@redfish-solutions.com>
Cc: x86@kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 arch/x86/platform/geode/net5501.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/x86/platform/geode/net5501.c b/arch/x86/platform/geode/net5501.c
index 927e38c0089f..a2f6b982a729 100644
--- a/arch/x86/platform/geode/net5501.c
+++ b/arch/x86/platform/geode/net5501.c
@@ -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 <philipp@redfish-solutions.com>");
-MODULE_DESCRIPTION("Soekris net5501 System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(net5501_init);
-- 
2.6.1

[toc] | [prev] | [next] | [standalone]


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

Fromtip-bot for Paul Gortmaker <tipbot@zytor.com>
Date2016-02-16 13:20 +0100
Subject[tip:x86/platform] x86/platform: Make platform/geode/ net5501.c explicitly non-modular
Message-ID<r2MLM-7HT-11@gated-at.bofh.it>
In reply to#1333772
Commit-ID:  605a46ee8353e8292e93baa5dc13e6be98bbec43
Gitweb:     http://git.kernel.org/tip/605a46ee8353e8292e93baa5dc13e6be98bbec43
Author:     Paul Gortmaker <paul.gortmaker@windriver.com>
AuthorDate: Sun, 14 Feb 2016 18:09:56 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
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.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Philip Prindeville <philipp@redfish-solutions.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1455491396-30977-6-git-send-email-paul.gortmaker@windriver.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/geode/net5501.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/x86/platform/geode/net5501.c b/arch/x86/platform/geode/net5501.c
index 927e38c..a2f6b98 100644
--- a/arch/x86/platform/geode/net5501.c
+++ b/arch/x86/platform/geode/net5501.c
@@ -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 <philipp@redfish-solutions.com>");
-MODULE_DESCRIPTION("Soekris net5501 System Setup");
-MODULE_LICENSE("GPL");
+device_initcall(net5501_init);

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web