Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751824AbcDTTNn (ORCPT ); Wed, 20 Apr 2016 15:13:43 -0400 Received: from mail1.windriver.com ([147.11.146.13]:34330 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbcDTTNm (ORCPT ); Wed, 20 Apr 2016 15:13:42 -0400 From: Paul Gortmaker To: CC: Paul Gortmaker , Christoph Hellwig , Ming Lin , Sagi Grimberg , "Martin K . Petersen" Subject: [PATCH] lib: make sg_pool explicitly non-modular Date: Wed, 20 Apr 2016 15:13:09 -0400 Message-ID: <1461179589-31089-1-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.8.0 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1557 Lines: 55 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 Cc: Ming Lin Cc: Sagi Grimberg Cc: Martin K. Petersen Signed-off-by: Paul Gortmaker --- 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 +#include #include #include #include @@ -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