From patchwork Mon Sep 28 19:51:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 523585 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EB489140A98 for ; Tue, 29 Sep 2015 05:54:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbbI1TyS (ORCPT ); Mon, 28 Sep 2015 15:54:18 -0400 Received: from mail.windriver.com ([147.11.1.11]:54973 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752017AbbI1TyR (ORCPT ); Mon, 28 Sep 2015 15:54:17 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id t8SJpvFN010870 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 28 Sep 2015 12:51:57 -0700 (PDT) Received: from yow-lpgnfs-02.corp.ad.wrs.com (128.224.149.8) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.235.1; Mon, 28 Sep 2015 12:51:57 -0700 From: Paul Gortmaker To: CC: Paul Gortmaker , "David S. Miller" , Eric Dumazet , Nicolas Dichtel , Daniel Borkmann , Alexei Starovoitov , Craig Gallek Subject: [PATCH 1/6] net/core: make sock_diag.c explicitly non-modular Date: Mon, 28 Sep 2015 15:51:25 -0400 Message-ID: <1443469890-19485-2-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.6.0.rc3 In-Reply-To: <1443469890-19485-1-git-send-email-paul.gortmaker@windriver.com> References: <1443469890-19485-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The Makefile currently controlling compilation of this code lists it under "obj-y" ...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 can change to one of the other priority initcalls (subsys?) at any later date, if desired. We can't remove module.h since the file uses other module related stuff even though it is not modular itself. We move the information from the MODULE_LICENSE tag to the top of the file, since that information is not captured anywhere else. The MODULE_ALIAS_NET_PF_PROTO becomes a no-op in the non modular case, so it is removed. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Nicolas Dichtel Cc: Daniel Borkmann Cc: Alexei Starovoitov Cc: Craig Gallek Cc: netdev@vger.kernel.org Signed-off-by: Paul Gortmaker --- net/core/sock_diag.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index 817622f3dbb7..0c1d58d43f67 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c @@ -1,3 +1,5 @@ +/* License: GPL */ + #include #include #include @@ -323,14 +325,4 @@ static int __init sock_diag_init(void) BUG_ON(!broadcast_wq); return register_pernet_subsys(&diag_net_ops); } - -static void __exit sock_diag_exit(void) -{ - unregister_pernet_subsys(&diag_net_ops); - destroy_workqueue(broadcast_wq); -} - -module_init(sock_diag_init); -module_exit(sock_diag_exit); -MODULE_LICENSE("GPL"); -MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_SOCK_DIAG); +device_initcall(sock_diag_init);