From patchwork Mon Sep 19 20:19:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 9340449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 339C0601C2 for ; Mon, 19 Sep 2016 20:19:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2577528B8F for ; Mon, 19 Sep 2016 20:19:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19DDB29881; Mon, 19 Sep 2016 20:19:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DFDB28B8F for ; Mon, 19 Sep 2016 20:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932124AbcISUTc (ORCPT ); Mon, 19 Sep 2016 16:19:32 -0400 Received: from mail1.windriver.com ([147.11.146.13]:44448 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbcISUTb (ORCPT ); Mon, 19 Sep 2016 16:19:31 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id u8JKJLEC016961 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 19 Sep 2016 13:19:21 -0700 (PDT) Received: from yow-lpgnfs-02.wrs.com (128.224.149.8) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.294.0; Mon, 19 Sep 2016 13:19:21 -0700 From: Paul Gortmaker To: CC: Paul Gortmaker , "J. Bruce Fields" , Jeff Layton , Trond Myklebust , Anna Schumaker , Subject: [PATCH] NFS: audit and remove any unnecessary uses of module.h Date: Mon, 19 Sep 2016 16:19:15 -0400 Message-ID: <20160919201915.28982-1-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.10.0 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. We also keep an eye out for module_param usage that doesn't have the corresponding moduleparam.h and fix accordingly. Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-nfs@vger.kernel.org Signed-off-by: Paul Gortmaker --- [I've been building this on linux-next on a regular basis for allmodconfig for x86(32/64) ARM(32/64) ppc and mips so there shouldn't be any unseen fallout.] fs/nfs/cache_lib.c | 1 - fs/nfs/callback.c | 1 - fs/nfs/delegation.c | 2 +- fs/nfs/dir.c | 3 ++- fs/nfs/direct.c | 2 +- fs/nfs/file.c | 2 +- fs/nfs/filelayout/filelayoutdev.c | 2 +- fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 +- fs/nfs/getroot.c | 2 -- fs/nfs/inode.c | 1 + fs/nfs/namespace.c | 2 +- fs/nfs/nfs4client.c | 2 +- fs/nfs/nfs4idmap.c | 2 +- fs/nfs/nfs4proc.c | 2 +- fs/nfs/nfs4session.c | 2 +- fs/nfs/nfs4xdr.c | 2 +- fs/nfs/pnfs_nfs.c | 2 +- fs/nfs/read.c | 2 +- fs/nfs/super.c | 4 ++-- fs/nfs/sysctl.c | 1 - fs/nfsd/export.c | 1 - fs/nfsd/fault_inject.c | 1 - fs/nfsd/nfs4idmap.c | 2 +- fs/nfsd/nfs4recover.c | 1 + fs/nfsd/stats.c | 1 - 25 files changed, 20 insertions(+), 25 deletions(-) diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c index 5f7b053720ee..3f8ebf4c4987 100644 --- a/fs/nfs/cache_lib.c +++ b/fs/nfs/cache_lib.c @@ -6,7 +6,6 @@ * Copyright (c) 2009 Trond Myklebust */ #include -#include #include #include #include diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index a7f2e6e33305..908ea10d95f7 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c @@ -8,7 +8,6 @@ #include #include -#include #include #include #include diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 322c2585bc34..c05e3369f684 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -8,7 +8,7 @@ */ #include #include -#include +#include #include #include #include diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 177fefb26c18..7d547a147cdd 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -17,7 +17,8 @@ * 6 Jun 1999 Cache readdir lookups in the page cache. -DaveM */ -#include +#include +#include #include #include #include diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 72b7d13ee3c6..2eb8df0bb186 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 7d620970f2e1..47d51ef87f74 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -16,7 +16,7 @@ * nfs regular file handling functions */ -#include +#include #include #include #include diff --git a/fs/nfs/filelayout/filelayoutdev.c b/fs/nfs/filelayout/filelayoutdev.c index 4946ef40ba87..d77ce25041b6 100644 --- a/fs/nfs/filelayout/filelayoutdev.c +++ b/fs/nfs/filelayout/filelayoutdev.c @@ -30,7 +30,7 @@ #include #include -#include +#include #include "../internal.h" #include "../nfs4session.h" diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index 0aa36be71fce..93e2893ed834 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include "../internal.h" diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c index a608ffd28acc..71e7bdd00ac3 100644 --- a/fs/nfs/getroot.c +++ b/fs/nfs/getroot.c @@ -9,9 +9,7 @@ * 2 of the License, or (at your option) any later version. */ -#include #include - #include #include #include diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index bf4ec5ecc97e..3b669b0190d5 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index c8162c660c44..274e323a4cab 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c @@ -7,7 +7,7 @@ * NFS namespace */ -#include +#include #include #include #include diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 8d7d08d4f95f..f19fb30c57c2 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -2,7 +2,7 @@ * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) */ -#include +#include #include #include #include diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c index c444285bb1b1..3ae3003586ea 100644 --- a/fs/nfs/nfs4idmap.c +++ b/fs/nfs/nfs4idmap.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include "internal.h" #include "netns.h" diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index a036e93bdf96..03e62a1d35a0 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c index 332d06e64fa9..631b7c795212 100644 --- a/fs/nfs/nfs4session.c +++ b/fs/nfs/nfs4session.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include "nfs4_fs.h" #include "internal.h" diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 7bd3a5c09d31..901b94e25af7 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index f3468b57a32a..55270bcb735d 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "nfs4session.h" #include "internal.h" diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 572e5b3b06f1..701436dcca56 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "nfs4_fs.h" #include "internal.h" diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 18d446e1a82b..6a10c88c105d 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -20,9 +20,9 @@ * of another (see nfs_lookup()) */ -#include #include - +#include +#include #include #include #include diff --git a/fs/nfs/sysctl.c b/fs/nfs/sysctl.c index bb6ed810fa6f..5ee2ad532138 100644 --- a/fs/nfs/sysctl.c +++ b/fs/nfs/sysctl.c @@ -8,7 +8,6 @@ #include #include #include -#include #include static struct ctl_table_header *nfs_callback_sysctl_table; diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 43e109cc0ccc..2dfd81efc04e 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -13,7 +13,6 @@ #include #include -#include #include #include diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c index c16bf5af6831..404bd11a9709 100644 --- a/fs/nfsd/fault_inject.c +++ b/fs/nfsd/fault_inject.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index 5b20577dcdd2..2a329b5c453c 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -32,7 +32,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include #include #include diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 66eaeb1e8c2c..73d985af4ad8 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c index d97338bb6a39..852ff9d31942 100644 --- a/fs/nfsd/stats.c +++ b/fs/nfsd/stats.c @@ -22,7 +22,6 @@ */ #include -#include #include #include