Commit 8bcfd3cc authored by Adrian Bunk's avatar Adrian Bunk Committed by David S. Miller

[NET]: misc cleanups

The patch below contains the following cleanups:
- make needlessly global code static
- remove the following unused global functions:
  - datagram.c: skb_copy_datagram
  - iovec.c: memcpy_tokerneliovec
- remove the following unneeded EXPORT_SYMBOL's:
  - datagram.c: skb_copy_datagram
  - dev.c: ing_filter
  - iovec.c: memcpy_tokerneliovec
  - netpoll.c: netpoll_send_skb
  - rtnetlink.c: rtnetlink_dump_ifinfo
  - sock.c: sock_alloc_send_pskb
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cabbb4de
......@@ -522,7 +522,6 @@ extern struct net_device loopback_dev; /* The loopback */
extern struct net_device *dev_base; /* All devices */
extern rwlock_t dev_base_lock; /* Device list lock */
extern int netdev_boot_setup_add(char *name, struct ifmap *map);
extern int netdev_boot_setup_check(struct net_device *dev);
extern unsigned long netdev_boot_base(const char *prefix, int unit);
extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr);
......
......@@ -175,10 +175,6 @@ extern void nf_reinject(struct sk_buff *skb,
extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *);
extern void nf_ct_attach(struct sk_buff *, struct sk_buff *);
#ifdef CONFIG_NETFILTER_DEBUG
extern void nf_dump_skb(int pf, struct sk_buff *skb);
#endif
/* FIXME: Before cache is ever used, this must be implemented for real. */
extern void nf_invalidate_cache(int pf);
......
......@@ -24,7 +24,6 @@ struct netpoll {
};
void netpoll_poll(struct netpoll *np);
void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
int netpoll_parse_options(struct netpoll *np, char *opt);
int netpoll_setup(struct netpoll *np);
......
......@@ -765,7 +765,6 @@ struct rtnetlink_link
};
extern struct rtnetlink_link * rtnetlink_links[NPROTO];
extern int rtnetlink_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb);
extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo);
extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
......
......@@ -1086,14 +1086,9 @@ extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
int noblock, int *err);
extern unsigned int datagram_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait);
extern int skb_copy_datagram(const struct sk_buff *from,
int offset, char __user *to, int size);
extern int skb_copy_datagram_iovec(const struct sk_buff *from,
int offset, struct iovec *to,
int size);
extern int skb_copy_and_csum_datagram(const struct sk_buff *skb,
int offset, u8 __user *to,
int len, unsigned int *csump);
extern int skb_copy_and_csum_datagram_iovec(const
struct sk_buff *skb,
int hlen,
......
......@@ -286,7 +286,6 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode);
extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
extern void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len);
extern int move_addr_to_user(void *kaddr, int klen, void __user *uaddr, int __user *ulen);
extern int move_addr_to_kernel(void __user *uaddr, int ulen, void *kaddr);
extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
......
......@@ -418,9 +418,6 @@ struct iw_public_data {
* Those may be called only within the kernel.
*/
/* Data needed by fs/compat_ioctl.c for 32->64 bit conversion */
extern const char iw_priv_type_size[];
/* First : function strictly used inside the kernel */
/* Handle /proc/net/wireless, called in net/code/dev.c */
......
......@@ -17,7 +17,6 @@ struct tcf_walker
extern int register_tcf_proto_ops(struct tcf_proto_ops *ops);
extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
extern int ing_filter(struct sk_buff *skb);
static inline unsigned long
__cls_set_class(unsigned long *clp, unsigned long cl)
......
......@@ -733,11 +733,6 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk,
unsigned long size,
int noblock,
int *errcode);
extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
unsigned long header_len,
unsigned long data_len,
int noblock,
int *errcode);
extern void *sock_kmalloc(struct sock *sk, int size, int priority);
extern void sock_kfree_s(struct sock *sk, void *mem, int size);
extern void sk_send_sigurg(struct sock *sk);
......@@ -795,8 +790,6 @@ extern void sk_common_release(struct sock *sk);
* Default socket callbacks and setup code
*/
extern void sock_def_destruct(struct sock *);
/* Initialise core socket variables */
extern void sock_init_data(struct socket *sock, struct sock *sk);
......
......@@ -199,19 +199,6 @@ void skb_free_datagram(struct sock *sk, struct sk_buff *skb)
kfree_skb(skb);
}
/*
* Copy a datagram to a linear buffer.
*/
int skb_copy_datagram(const struct sk_buff *skb, int offset, char __user *to, int size)
{
struct iovec iov = {
.iov_base = to,
.iov_len =size,
};
return skb_copy_datagram_iovec(skb, offset, &iov, size);
}
/**
* skb_copy_datagram_iovec - Copy a datagram to an iovec.
* @skb - buffer to copy
......@@ -296,8 +283,9 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
return -EFAULT;
}
int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
u8 __user *to, int len, unsigned int *csump)
static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
u8 __user *to, int len,
unsigned int *csump)
{
int start = skb_headlen(skb);
int pos = 0;
......@@ -489,7 +477,6 @@ unsigned int datagram_poll(struct file *file, struct socket *sock,
EXPORT_SYMBOL(datagram_poll);
EXPORT_SYMBOL(skb_copy_and_csum_datagram_iovec);
EXPORT_SYMBOL(skb_copy_datagram);
EXPORT_SYMBOL(skb_copy_datagram_iovec);
EXPORT_SYMBOL(skb_free_datagram);
EXPORT_SYMBOL(skb_recv_datagram);
......@@ -183,7 +183,7 @@ static struct timer_list samp_timer = TIMER_INITIALIZER(sample_queue, 0, 0);
* semaphore held.
*/
struct net_device *dev_base;
struct net_device **dev_tail = &dev_base;
static struct net_device **dev_tail = &dev_base;
rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
EXPORT_SYMBOL(dev_base);
......@@ -361,7 +361,7 @@ static struct netdev_boot_setup dev_boot_setup[NETDEV_BOOT_SETUP_MAX];
* returns 0 on error and 1 on success. This is a generic routine to
* all netdevices.
*/
int netdev_boot_setup_add(char *name, struct ifmap *map)
static int netdev_boot_setup_add(char *name, struct ifmap *map)
{
struct netdev_boot_setup *s;
int i;
......@@ -644,7 +644,7 @@ struct net_device * dev_get_by_flags(unsigned short if_flags, unsigned short mas
* Network device names need to be valid file names to
* to allow sysfs to work
*/
int dev_valid_name(const char *name)
static int dev_valid_name(const char *name)
{
return !(*name == '\0'
|| !strcmp(name, ".")
......@@ -1590,7 +1590,7 @@ static __inline__ int handle_bridge(struct sk_buff **pskb,
* the ingress scheduler, you just cant add policies on ingress.
*
*/
int ing_filter(struct sk_buff *skb)
static int ing_filter(struct sk_buff *skb)
{
struct Qdisc *q;
struct net_device *dev = skb->dev;
......@@ -3346,9 +3346,4 @@ EXPORT_SYMBOL(br_handle_frame_hook);
EXPORT_SYMBOL(dev_load);
#endif
#ifdef CONFIG_NET_CLS_ACT
EXPORT_SYMBOL(ing_filter);
#endif
EXPORT_PER_CPU_SYMBOL(softnet_data);
......@@ -264,7 +264,7 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void
return NOTIFY_DONE;
}
struct notifier_block dst_dev_notifier = {
static struct notifier_block dst_dev_notifier = {
.notifier_call = dst_dev_event,
};
......
......@@ -98,28 +98,6 @@ int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len)
return 0;
}
/*
* In kernel copy to iovec. Returns -EFAULT on error.
*
* Note: this modifies the original iovec.
*/
void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len)
{
while (len > 0) {
if (iov->iov_len) {
int copy = min_t(unsigned int, iov->iov_len, len);
memcpy(iov->iov_base, kdata, copy);
kdata += copy;
len -= copy;
iov->iov_len -= copy;
iov->iov_base += copy;
}
iov++;
}
}
/*
* Copy iovec to kernel. Returns -EFAULT on error.
*
......@@ -259,4 +237,3 @@ EXPORT_SYMBOL(csum_partial_copy_fromiovecend);
EXPORT_SYMBOL(memcpy_fromiovec);
EXPORT_SYMBOL(memcpy_fromiovecend);
EXPORT_SYMBOL(memcpy_toiovec);
EXPORT_SYMBOL(memcpy_tokerneliovec);
......@@ -173,7 +173,7 @@ static void debug_print_hooks_ip(unsigned int nf_debug)
printk("\n");
}
void nf_dump_skb(int pf, struct sk_buff *skb)
static void nf_dump_skb(int pf, struct sk_buff *skb)
{
printk("skb: pf=%i %s dev=%s len=%u\n",
pf,
......
......@@ -39,7 +39,7 @@ static spinlock_t rx_list_lock = SPIN_LOCK_UNLOCKED;
static LIST_HEAD(rx_list);
static atomic_t trapped;
spinlock_t netpoll_poll_lock = SPIN_LOCK_UNLOCKED;
static spinlock_t netpoll_poll_lock = SPIN_LOCK_UNLOCKED;
#define NETPOLL_RX_ENABLED 1
#define NETPOLL_RX_DROP 2
......@@ -178,7 +178,7 @@ static struct sk_buff * find_skb(struct netpoll *np, int len, int reserve)
return skb;
}
void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
{
int status;
......@@ -676,6 +676,5 @@ EXPORT_SYMBOL(netpoll_trap);
EXPORT_SYMBOL(netpoll_parse_options);
EXPORT_SYMBOL(netpoll_setup);
EXPORT_SYMBOL(netpoll_cleanup);
EXPORT_SYMBOL(netpoll_send_skb);
EXPORT_SYMBOL(netpoll_send_udp);
EXPORT_SYMBOL(netpoll_poll);
......@@ -241,7 +241,7 @@ static int rtnetlink_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
return -1;
}
int rtnetlink_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
static int rtnetlink_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
{
int idx;
int s_idx = cb->args[0];
......@@ -691,7 +691,6 @@ void __init rtnetlink_init(void)
EXPORT_SYMBOL(__rta_fill);
EXPORT_SYMBOL(rtattr_parse);
EXPORT_SYMBOL(rtnetlink_dump_ifinfo);
EXPORT_SYMBOL(rtnetlink_links);
EXPORT_SYMBOL(rtnetlink_put_metrics);
EXPORT_SYMBOL(rtnl);
......
......@@ -825,8 +825,10 @@ static long sock_wait_for_wmem(struct sock * sk, long timeo)
* Generic send/receive buffer handlers
*/
struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len,
unsigned long data_len, int noblock, int *errcode)
static struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
unsigned long header_len,
unsigned long data_len,
int noblock, int *errcode)
{
struct sk_buff *skb;
unsigned int gfp_mask;
......@@ -1084,7 +1086,7 @@ ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset, siz
* Default Socket Callbacks
*/
void sock_def_wakeup(struct sock *sk)
static void sock_def_wakeup(struct sock *sk)
{
read_lock(&sk->sk_callback_lock);
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
......@@ -1092,7 +1094,7 @@ void sock_def_wakeup(struct sock *sk)
read_unlock(&sk->sk_callback_lock);
}
void sock_def_error_report(struct sock *sk)
static void sock_def_error_report(struct sock *sk)
{
read_lock(&sk->sk_callback_lock);
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
......@@ -1101,7 +1103,7 @@ void sock_def_error_report(struct sock *sk)
read_unlock(&sk->sk_callback_lock);
}
void sock_def_readable(struct sock *sk, int len)
static void sock_def_readable(struct sock *sk, int len)
{
read_lock(&sk->sk_callback_lock);
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
......@@ -1110,7 +1112,7 @@ void sock_def_readable(struct sock *sk, int len)
read_unlock(&sk->sk_callback_lock);
}
void sock_def_write_space(struct sock *sk)
static void sock_def_write_space(struct sock *sk)
{
read_lock(&sk->sk_callback_lock);
......@@ -1129,7 +1131,7 @@ void sock_def_write_space(struct sock *sk)
read_unlock(&sk->sk_callback_lock);
}
void sock_def_destruct(struct sock *sk)
static void sock_def_destruct(struct sock *sk)
{
if (sk->sk_protinfo)
kfree(sk->sk_protinfo);
......@@ -1368,7 +1370,6 @@ EXPORT_SYMBOL(sk_free_slab);
EXPORT_SYMBOL(sk_alloc);
EXPORT_SYMBOL(sk_free);
EXPORT_SYMBOL(sk_send_sigurg);
EXPORT_SYMBOL(sock_alloc_send_pskb);
EXPORT_SYMBOL(sock_alloc_send_skb);
EXPORT_SYMBOL(sock_init_data);
EXPORT_SYMBOL(sock_kfree_s);
......
......@@ -304,7 +304,7 @@ static const int standard_event_num = (sizeof(standard_event) /
sizeof(struct iw_ioctl_description));
/* Size (in bytes) of the various private data types */
const char iw_priv_type_size[] = {
static const char iw_priv_type_size[] = {
0, /* IW_PRIV_TYPE_NONE */
1, /* IW_PRIV_TYPE_BYTE */
1, /* IW_PRIV_TYPE_CHAR */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment