All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Christoph Hellwig <hch@lst.de>, Ming Lin <ming.l@ssi.samsung.com>,
	Sagi Grimberg <sagi@grimberg.me>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: [PATCH] lib: make sg_pool explicitly non-modular
Date: Wed, 20 Apr 2016 15:13:09 -0400	[thread overview]
Message-ID: <1461179589-31089-1-git-send-email-paul.gortmaker@windriver.com> (raw)

The recently added Kconfig controlling compilation of this code is:

lib/Kconfig:config SG_POOL
lib/Kconfig:    def_bool n

...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.  However
one might want to consider moving it to subsys_initcall if it is to
be ready ahead of SCSI drivers wanting this and using device_initcall.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lin <ming.l@ssi.samsung.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 lib/sg_pool.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/lib/sg_pool.c b/lib/sg_pool.c
index 6dd30615a201..e2cf548b9610 100644
--- a/lib/sg_pool.c
+++ b/lib/sg_pool.c
@@ -1,4 +1,4 @@
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/scatterlist.h>
 #include <linux/mempool.h>
 #include <linux/slab.h>
@@ -156,17 +156,4 @@ cleanup_sdb:
 
 	return -ENOMEM;
 }
-
-static __exit void sg_pool_exit(void)
-{
-	int i;
-
-	for (i = 0; i < SG_MEMPOOL_NR; i++) {
-		struct sg_pool *sgp = sg_pools + i;
-		mempool_destroy(sgp->pool);
-		kmem_cache_destroy(sgp->slab);
-	}
-}
-
-module_init(sg_pool_init);
-module_exit(sg_pool_exit);
+device_initcall(sg_pool_init);
-- 
2.8.0

             reply	other threads:[~2016-04-20 19:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 19:13 Paul Gortmaker [this message]
2016-04-20 20:28 ` [PATCH] lib: make sg_pool explicitly non-modular Ming Lin
2016-04-21  3:02   ` Paul Gortmaker
2016-04-21  4:23     ` Ming Lin

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=1461179589-31089-1-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.l@ssi.samsung.com \
    --cc=sagi@grimberg.me \
    /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.