Skip to content

Commit cd06157

Browse files
congwangdavem330
authored andcommitted
net: fix a build failure when !CONFIG_PROC_FS
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 <[email protected]> Cc: Gao feng <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 082c7ca commit cd06157

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

include/linux/netdevice.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2646,7 +2646,6 @@ extern void netdev_notify_peers(struct net_device *dev);
26462646
extern void netdev_features_change(struct net_device *dev);
26472647
/* Load a device via the kmod */
26482648
extern void dev_load(struct net *net, const char *name);
2649-
extern void dev_mcast_init(void);
26502649
extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
26512650
struct rtnl_link_stats64 *storage);
26522651
extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,

net/core/dev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6260,7 +6260,6 @@ static int __init net_dev_init(void)
62606260

62616261
hotcpu_notifier(dev_cpu_callback, 0);
62626262
dst_init();
6263-
dev_mcast_init();
62646263
rc = 0;
62656264
out:
62666265
return rc;

net/core/net-procfs.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,6 @@ static struct pernet_operations __net_initdata dev_proc_ops = {
341341
.exit = dev_proc_net_exit,
342342
};
343343

344-
int __init dev_proc_init(void)
345-
{
346-
return register_pernet_subsys(&dev_proc_ops);
347-
}
348-
349344
static int dev_mc_seq_show(struct seq_file *seq, void *v)
350345
{
351346
struct netdev_hw_addr *ha;
@@ -408,7 +403,10 @@ static struct pernet_operations __net_initdata dev_mc_net_ops = {
408403
.exit = dev_mc_net_exit,
409404
};
410405

411-
void __init dev_mcast_init(void)
406+
int __init dev_proc_init(void)
412407
{
413-
register_pernet_subsys(&dev_mc_net_ops);
408+
int ret = register_pernet_subsys(&dev_proc_ops);
409+
if (!ret)
410+
return register_pernet_subsys(&dev_mc_net_ops);
411+
return ret;
414412
}

0 commit comments

Comments
 (0)