Skip to content

Commit 342709e

Browse files
xemulDavid S. Miller
authored andcommitted
[NET]: Remove in-code externs for some functions from net/core/dev.c
Inconsistent prototype and real type for functions may have worse consequences, than those for variables, so move them into a header. Since they are used privately in net/core, make this file reside in the same place. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a37ae40 commit 342709e

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎net/core/dev.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
#include <linux/ctype.h>
121121
#include <linux/if_arp.h>
122122

123+
#include "net-sysfs.h"
124+
123125
/*
124126
* The list of packet types we will receive (as opposed to discard)
125127
* and the routines to invoke.
@@ -249,10 +251,6 @@ static RAW_NOTIFIER_HEAD(netdev_chain);
249251

250252
DEFINE_PER_CPU(struct softnet_data, softnet_data);
251253

252-
extern int netdev_kobject_init(void);
253-
extern int netdev_register_kobject(struct net_device *);
254-
extern void netdev_unregister_kobject(struct net_device *);
255-
256254
#ifdef CONFIG_DEBUG_LOCK_ALLOC
257255
/*
258256
* register_netdevice() inits dev->_xmit_lock and sets lockdep class

‎net/core/net-sysfs.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <linux/wireless.h>
1919
#include <net/iw_handler.h>
2020

21+
#include "net-sysfs.h"
22+
2123
#ifdef CONFIG_SYSFS
2224
static const char fmt_hex[] = "%#x\n";
2325
static const char fmt_long_hex[] = "%#lx\n";

‎net/core/net-sysfs.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef __NET_SYSFS_H__
2+
#define __NET_SYSFS_H__
3+
4+
int netdev_kobject_init(void);
5+
int netdev_register_kobject(struct net_device *);
6+
void netdev_unregister_kobject(struct net_device *);
7+
8+
#endif

0 commit comments

Comments
 (0)