From patchwork Tue Feb 19 12:47:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Wang X-Patchwork-Id: 221694 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 74C222C0291 for ; Tue, 19 Feb 2013 23:47:41 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756642Ab3BSMra (ORCPT ); Tue, 19 Feb 2013 07:47:30 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:50805 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379Ab3BSMrU (ORCPT ); Tue, 19 Feb 2013 07:47:20 -0500 Received: by mail-pa0-f41.google.com with SMTP id fb11so3425807pad.28 for ; Tue, 19 Feb 2013 04:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=ouKmI9BripXO/T1fOdUG6xKXejuzHfmnB5sqeGleANM=; b=S9KiDqV7Fl2uF1jxeLVfCLrhbY2ZWfQyEbekfMVaWwhChKkfP7nECinp+rzI8/KrL6 Op9ylG2nYJmluUCcqZrVBTZ8wnX0CJ8tbC9IXZGM9Li217b9siFxsRkelA1FDwSEFUsX zCjo5J8WHDazyX6/YdwDB//Q6OBWOsWkDKm2UzyDBk07n68eZX6DSh2OAB+vh4Cxturq MZ9YO1QK1L4BwWp0UyQCwV1fk1Aa3c7mQPyQ9BMphYQUrgltpOPemxHzPMndB8V5HGZe glai6/vvvK+JdfADNn/Ri3F0JRg8M08hntq0xeqpNYT+3nVZ73JbAZSJcU2EuRgGl5AA WtUA== X-Received: by 10.68.242.99 with SMTP id wp3mr39908808pbc.143.1361278039619; Tue, 19 Feb 2013 04:47:19 -0800 (PST) Received: from cr0.redhat.com ([180.129.240.107]) by mx.google.com with ESMTPS id kc15sm17946536pbb.5.2013.02.19.04.47.15 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Feb 2013 04:47:18 -0800 (PST) From: Cong Wang To: netdev@vger.kernel.org Cc: Gao feng , "David S. Miller" , Cong Wang Subject: [Patch] net: fix a build failure when !CONFIG_PROC_FS Date: Tue, 19 Feb 2013 20:47:05 +0800 Message-Id: <1361278025-22864-1-git-send-email-xiyou.wangcong@gmail.com> X-Mailer: git-send-email 1.7.7.6 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Cong Wang When !CONFIG_PROC_FS dev_mcast_init() is not defined, actually we can just merge dev_mcast_init() into dev_proc_init(). Reported-by: Gao feng Cc: Gao feng Cc: "David S. Miller" Signed-off-by: Cong Wang --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f111b4f..b3d00fa 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2646,7 +2646,6 @@ extern void netdev_notify_peers(struct net_device *dev); extern void netdev_features_change(struct net_device *dev); /* Load a device via the kmod */ extern void dev_load(struct net *net, const char *name); -extern void dev_mcast_init(void); extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, struct rtnl_link_stats64 *storage); extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, diff --git a/net/core/dev.c b/net/core/dev.c index 8d9ddb0..17bc535 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6260,7 +6260,6 @@ static int __init net_dev_init(void) hotcpu_notifier(dev_cpu_callback, 0); dst_init(); - dev_mcast_init(); rc = 0; out: return rc; diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c index ac87066..0f6bb6f 100644 --- a/net/core/net-procfs.c +++ b/net/core/net-procfs.c @@ -341,11 +341,6 @@ static struct pernet_operations __net_initdata dev_proc_ops = { .exit = dev_proc_net_exit, }; -int __init dev_proc_init(void) -{ - return register_pernet_subsys(&dev_proc_ops); -} - static int dev_mc_seq_show(struct seq_file *seq, void *v) { struct netdev_hw_addr *ha; @@ -408,7 +403,10 @@ static struct pernet_operations __net_initdata dev_mc_net_ops = { .exit = dev_mc_net_exit, }; -void __init dev_mcast_init(void) +int __init dev_proc_init(void) { - register_pernet_subsys(&dev_mc_net_ops); + int ret = register_pernet_subsys(&dev_proc_ops); + if (!ret) + return register_pernet_subsys(&dev_mc_net_ops); + return ret; }