]> git.karo-electronics.de Git - linux-beck.git/commitdiff
dlm: audit and remove any unnecessary uses of module.h
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 19 Sep 2016 20:44:50 +0000 (16:44 -0400)
committerDavid Teigland <teigland@redhat.com>
Wed, 19 Oct 2016 16:00:03 +0000 (11:00 -0500)
Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.

In the case of some code where it is modular, we can extend that to
also include files that are building basic support functionality but
not related to loading or registering the final module; such files
also have no need whatsoever for module.h

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace as needed.

In the dlm case, we remove module.h from a global header and only
introduce it in the files where it is explicitly required, since
there is nothing modular in dlm_internal.h itself.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/config.c
fs/dlm/debug_fs.c
fs/dlm/dlm_internal.h
fs/dlm/lockspace.c
fs/dlm/main.c
fs/dlm/user.c

index df955d2209ce983754dee1e27dce00f56d530605..7211e826d90dfc1be4cb36a096b1a43d2a138154 100644 (file)
@@ -12,7 +12,7 @@
 ******************************************************************************/
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/configfs.h>
 #include <linux/slab.h>
 #include <linux/in.h>
index 466f7d60edc2746f12a425ec91df2773f64dfedb..ca7089aeadabb5c0801fdc337a681c82aadfff14 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <linux/pagemap.h>
 #include <linux/seq_file.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/debugfs.h>
 #include <linux/slab.h>
index 216b61604ef909ec5d341fb44628923bf15a5238..b670f5601fbb4f779ead4148a2d007f1026cf01f 100644 (file)
@@ -18,7 +18,6 @@
  * This is the main header file to be included in each DLM source file.
  */
 
-#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/types.h>
index f3e72787e7f9dbadac6e9b4b22bcd9420009a1c1..91592b75c309adf729710613c3fc572831782618 100644 (file)
@@ -11,6 +11,8 @@
 *******************************************************************************
 ******************************************************************************/
 
+#include <linux/module.h>
+
 #include "dlm_internal.h"
 #include "lockspace.h"
 #include "member.h"
index 079c0bd71ab77eb291f704022daa9cf50567347d..8e1b618891bee6c997c2d9ebb8149c50db19b863 100644 (file)
@@ -11,6 +11,8 @@
 *******************************************************************************
 ******************************************************************************/
 
+#include <linux/module.h>
+
 #include "dlm_internal.h"
 #include "lockspace.h"
 #include "lock.h"
index 58c2f4a21b7f4233b34b70efb0602b297d7f9012..1ce908c2232c38bf0e6fd71d7ec15a4fa60251c2 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/miscdevice.h>
 #include <linux/init.h>
 #include <linux/wait.h>
-#include <linux/module.h>
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/poll.h>