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


Groups > linux.kernel > #1203368 > unrolled thread

[PATCH 0/4] char/misc: make some drivers more explicitly non-modular

Started byPaul Gortmaker <paul.gortmaker@windriver.com>
First post2015-08-08 22:40 +0200
Last post2015-08-08 22:40 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/4] char/misc: make some drivers more explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2015-08-08 22:40 +0200
    [PATCH 2/4] drivers/char: make SGI snsc.c driver explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2015-08-08 22:40 +0200

#1203368 — [PATCH 0/4] char/misc: make some drivers more explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2015-08-08 22:40 +0200
Subject[PATCH 0/4] char/misc: make some drivers more explicitly non-modular
Message-ID<pVj4m-19X-7@gated-at.bofh.it>
In the previous merge window, we made changes to allow better
delineation between modular and non-modular code in commit
0fd972a7d91d6e15393c449492a04d94c0b89351 ("module: relocate module_init
from init.h to module.h").  This allows us to now ensure module code
looks modular and non-modular code does not accidentally look modular
without suffering build breakage.

Here we target code that is, by nature of their Kconfig settings, only
available to be built-in, but implicitly presenting itself as being
possibly modular by way of using modular headers, macros, and functions.

The goal here is to remove that illusion of modularity from these
drivers, but in a way that leaves the actual runtime unchanged.
In doing so, we remove code that has never been tested and adds
no value to the tree.  And we advance the process of expecting a
level of consistency between the Kconfig of a driver and the code
that the driver uses.

Build tested on and x86-64, and on ia64 for snsc.c after applying
to a baseline of char-misc/char-misc-next

Paul.
---

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: kgdb-bugreport@lists.sourceforge.net

Paul Gortmaker (4):
  drivers/char: make efirtc.c driver explicitly non-modular
  drivers/char: make SGI snsc.c driver explicitly non-modular
  drivers/char: make hpet.c explicitly non-modular
  drivers/misc: make kgdbts.c slightly more explicitly non-modular

 drivers/char/efirtc.c | 13 +++----------
 drivers/char/hpet.c   | 25 +++----------------------
 drivers/char/snsc.c   |  5 ++---
 drivers/misc/kgdbts.c | 10 +++++-----
 4 files changed, 13 insertions(+), 40 deletions(-)

-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1203369 — [PATCH 2/4] drivers/char: make SGI snsc.c driver explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2015-08-08 22:40 +0200
Subject[PATCH 2/4] drivers/char: make SGI snsc.c driver explicitly non-modular
Message-ID<pVj4m-19X-19@gated-at.bofh.it>
In reply to#1203368
The Kconfig for this driver is currently:

config SGI_SNSC
    bool "SGI Altix system controller communication support"

...meaning that it currently is not being built as a module by anyone.
Lets remove all modular references, 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.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/char/snsc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index 8a80ead8d316..94006f9c2e43 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -19,7 +19,7 @@
 #include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/poll.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
 #include <asm/sn/io.h>
@@ -461,5 +461,4 @@ scdrv_init(void)
 	}
 	return 0;
 }
-
-module_init(scdrv_init);
+device_initcall(scdrv_init);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web