From patchwork Wed Jan 15 14:52:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 311164 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 142172C0082 for ; Thu, 16 Jan 2014 01:52:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752266AbaAOOwY (ORCPT ); Wed, 15 Jan 2014 09:52:24 -0500 Received: from mail.windriver.com ([147.11.1.11]:45136 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260AbaAOOwX (ORCPT ); Wed, 15 Jan 2014 09:52:23 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.5/8.14.5) with ESMTP id s0FEqKwC009424 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 15 Jan 2014 06:52:20 -0800 (PST) Received: from yow-asskicker.wrs.com (128.224.146.66) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.2.347.0; Wed, 15 Jan 2014 06:52:20 -0800 From: Paul Gortmaker To: "David S. Miller" CC: , Paul Gortmaker , Eric Dumazet Subject: [PATCH] net/ipv4: don't use module_init in non-modular gre_offload Date: Wed, 15 Jan 2014 09:52:14 -0500 Message-ID: <1389797534-15657-1-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 1.8.5.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Recent commit 438e38fadca2f6e57eeecc08326c8a95758594d4 ("gre_offload: statically build GRE offloading support") added new module_init/module_exit calls to the gre_offload.c file. The file is obj-y and can't be anything other than built-in. Currently it can never be built modular, so using module_init as an alias for __initcall can be somewhat misleading. Fix this up now, so that we can relocate module_init from init.h into module.h in the future. If we don't do this, we'd have to add module.h to obviously non-modular code, and that would be a worse thing. We also make the inclusion explicit. Note that direct use of __initcall is discouraged, vs. one of the priority categorized subgroups. As __initcall gets mapped onto device_initcall, our use of device_initcall directly in this change means that the runtime impact is zero -- it will remain at level 6 in initcall ordering. Cc: Eric Dumazet Signed-off-by: Paul Gortmaker diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c index 29512e3e7e7c..ed968daf2380 100644 --- a/net/ipv4/gre_offload.c +++ b/net/ipv4/gre_offload.c @@ -11,6 +11,7 @@ */ #include +#include #include #include @@ -283,11 +284,10 @@ static int __init gre_offload_init(void) { return inet_add_offload(&gre_offload, IPPROTO_GRE); } +device_initcall(gre_offload_init); static void __exit gre_offload_exit(void) { inet_del_offload(&gre_offload, IPPROTO_GRE); } - -module_init(gre_offload_init); -module_exit(gre_offload_exit); +__exitcall(gre_offload_exit);