From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755458AbdDMAcX (ORCPT ); Wed, 12 Apr 2017 20:32:23 -0400 Received: from mail.windriver.com ([147.11.1.11]:33397 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbdDMAcV (ORCPT ); Wed, 12 Apr 2017 20:32:21 -0400 From: Paul Gortmaker To: CC: , Paul Gortmaker , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Evgeny Baskakov , John Hubbard , Mark Hairgrove , Sherry Cheung , Subhash Gutti , Andrew Morton Subject: [PATCH 1/4] mm/hmm: make it explicitly non-modular Date: Wed, 12 Apr 2017 20:30:11 -0400 Message-ID: <20170413003014.4052-2-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170413003014.4052-1-paul.gortmaker@windriver.com> References: <20170413003014.4052-1-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Evgeny Baskakov Cc: John Hubbard Cc: Mark Hairgrove Cc: Sherry Cheung Cc: Subhash Gutti Cc: Andrew Morton Signed-off-by: Paul Gortmaker --- 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 #include +#include #include #include #include #include #include -#include #include #include #include @@ -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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Gortmaker Subject: [PATCH 1/4] mm/hmm: make it explicitly non-modular Date: Wed, 12 Apr 2017 20:30:11 -0400 Message-ID: <20170413003014.4052-2-paul.gortmaker@windriver.com> References: <20170413003014.4052-1-paul.gortmaker@windriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Return-path: Received: from mail.windriver.com ([147.11.1.11]:33397 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbdDMAcV (ORCPT ); Wed, 12 Apr 2017 20:32:21 -0400 In-Reply-To: <20170413003014.4052-1-paul.gortmaker@windriver.com> Sender: linux-next-owner@vger.kernel.org List-ID: To: linux-kernel@vger.kernel.org Cc: linux-next@vger.kernel.org, Paul Gortmaker , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Evgeny Baskakov , John Hubbard , Mark Hairgrove , Sherry Cheung , Subhash Gutti , Andrew Morton 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 Cc: Evgeny Baskakov Cc: John Hubbard Cc: Mark Hairgrove Cc: Sherry Cheung Cc: Subhash Gutti Cc: Andrew Morton Signed-off-by: Paul Gortmaker --- 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 #include +#include #include #include #include #include #include -#include #include #include #include @@ -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