All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: linux-next@vger.kernel.org,
	"Paul Gortmaker" <paul.gortmaker@windriver.com>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Evgeny Baskakov" <ebaskakov@nvidia.com>,
	"John Hubbard" <jhubbard@nvidia.com>,
	"Mark Hairgrove" <mhairgrove@nvidia.com>,
	"Sherry Cheung" <SCheung@nvidia.com>,
	"Subhash Gutti" <sgutti@nvidia.com>,
	"Andrew Morton" <akpm@linux-foundation.org>
Subject: [PATCH 1/4] mm/hmm: make it explicitly non-modular
Date: Wed, 12 Apr 2017 20:30:11 -0400	[thread overview]
Message-ID: <20170413003014.4052-2-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <20170413003014.4052-1-paul.gortmaker@windriver.com>

The Kconfig currently controlling compilation of this code is:

mm/Kconfig:config HMM
mm/Kconfig:     bool

...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 also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Evgeny Baskakov <ebaskakov@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Mark Hairgrove <mhairgrove@nvidia.com>
Cc: Sherry Cheung <SCheung@nvidia.com>
Cc: Subhash Gutti <sgutti@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 mm/hmm.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/mm/hmm.c b/mm/hmm.c
index f567a8b3b079..8200cf275fb9 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -19,12 +19,12 @@
  */
 #include <linux/mm.h>
 #include <linux/hmm.h>
+#include <linux/init.h>
 #include <linux/rmap.h>
 #include <linux/swap.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/mmzone.h>
-#include <linux/module.h>
 #include <linux/pagemap.h>
 #include <linux/swapops.h>
 #include <linux/hugetlb.h>
@@ -1192,14 +1192,5 @@ static int __init hmm_init(void)
 	}
 	return 0;
 }
-
-static void __exit hmm_exit(void)
-{
-	unregister_chrdev_region(hmm_device_devt, HMM_DEVICE_MAX);
-	class_destroy(hmm_device_class);
-}
-
-module_init(hmm_init);
-module_exit(hmm_exit);
-MODULE_LICENSE("GPL");
+device_initcall(hmm_init);
 #endif /* IS_ENABLED(CONFIG_HMM_DEVMEM) */
-- 
2.11.0

WARNING: multiple messages have this Message-ID (diff)
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: linux-next@vger.kernel.org,
	"Paul Gortmaker" <paul.gortmaker@windriver.com>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Evgeny Baskakov" <ebaskakov@nvidia.com>,
	"John Hubbard" <jhubbard@nvidia.com>,
	"Mark Hairgrove" <mhairgrove@nvidia.com>,
	"Sherry Cheung" <SCheung@nvidia.com>,
	"Subhash Gutti" <sgutti@nvidia.com>,
	"Andrew Morton" <akpm@linux-foundation.org>
Subject: [PATCH 1/4] mm/hmm: make it explicitly non-modular
Date: Wed, 12 Apr 2017 20:30:11 -0400	[thread overview]
Message-ID: <20170413003014.4052-2-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <20170413003014.4052-1-paul.gortmaker@windriver.com>

The Kconfig currently controlling compilation of this code is:

mm/Kconfig:config HMM
mm/Kconfig:     bool

...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 also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Evgeny Baskakov <ebaskakov@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Mark Hairgrove <mhairgrove@nvidia.com>
Cc: Sherry Cheung <SCheung@nvidia.com>
Cc: Subhash Gutti <sgutti@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 mm/hmm.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/mm/hmm.c b/mm/hmm.c
index f567a8b3b079..8200cf275fb9 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -19,12 +19,12 @@
  */
 #include <linux/mm.h>
 #include <linux/hmm.h>
+#include <linux/init.h>
 #include <linux/rmap.h>
 #include <linux/swap.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/mmzone.h>
-#include <linux/module.h>
 #include <linux/pagemap.h>
 #include <linux/swapops.h>
 #include <linux/hugetlb.h>
@@ -1192,14 +1192,5 @@ static int __init hmm_init(void)
 	}
 	return 0;
 }
-
-static void __exit hmm_exit(void)
-{
-	unregister_chrdev_region(hmm_device_devt, HMM_DEVICE_MAX);
-	class_destroy(hmm_device_class);
-}
-
-module_init(hmm_init);
-module_exit(hmm_exit);
-MODULE_LICENSE("GPL");
+device_initcall(hmm_init);
 #endif /* IS_ENABLED(CONFIG_HMM_DEVMEM) */
-- 
2.11.0

  reply	other threads:[~2017-04-13  0:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13  0:30 [PATCH akpm/next 0/4] Fix various issues in new hmm driver Paul Gortmaker
2017-04-13  0:30 ` Paul Gortmaker
2017-04-13  0:30 ` Paul Gortmaker [this message]
2017-04-13  0:30   ` [PATCH 1/4] mm/hmm: make it explicitly non-modular Paul Gortmaker
2017-04-13  0:30 ` [PATCH 2/4] mm/hmm: fix warnings and SECTION_SIZE definition overlap Paul Gortmaker
2017-04-13  0:30   ` Paul Gortmaker
2017-04-14  0:27   ` kbuild test robot
2017-04-14  0:27     ` kbuild test robot
2017-04-13  0:30 ` [PATCH 3/4] mm/hmm: fix Kconfig to have valid usage of "select" Paul Gortmaker
2017-04-13  0:30   ` Paul Gortmaker
2017-04-13  0:30 ` [PATCH 4/4] mm/hmm: exclude 64 bit arch that explicitly fail to work Paul Gortmaker
2017-04-13  0:30   ` Paul Gortmaker
2017-04-13  3:27   ` Stephen Rothwell
2017-04-13  3:56     ` Paul Gortmaker
2017-04-13  5:12     ` Michael Ellerman
2017-04-13 12:03       ` Paul Gortmaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170413003014.4052-2-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=SCheung@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebaskakov@nvidia.com \
    --cc=jglisse@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mhairgrove@nvidia.com \
    --cc=sgutti@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.