[2.6 patch] net/packet/af_packet.c: make some code static

From: Adrian Bunk (bunk_at_stusta.de)
Date: 12/15/04

  • Next message: Adrian Bunk: "[2.6 patch] net/ipv4/netfilter/: misc possible cleanups"
    Date:	Wed, 15 Dec 2004 01:47:45 +0100
    To: netdev@oss.sgi.com
    
    

    The patch below makes some needlessly global code static.

    diffstat output:
     net/packet/af_packet.c | 21 +++++++++++----------
     1 files changed, 11 insertions(+), 10 deletions(-)

    Signed-off-by: Adrian Bunk <bunk@stusta.de>

    --- linux-2.6.10-rc3-mm1-full/net/packet/af_packet.c.old 2004-12-14 21:47:49.000000000 +0100
    +++ linux-2.6.10-rc3-mm1-full/net/packet/af_packet.c 2004-12-14 21:50:25.000000000 +0100
    @@ -145,10 +145,10 @@
      */
     
     /* List of all packet sockets. */
    -HLIST_HEAD(packet_sklist);
    +static HLIST_HEAD(packet_sklist);
     static rwlock_t packet_sklist_lock = RW_LOCK_UNLOCKED;
     
    -atomic_t packet_socks_nr;
    +static atomic_t packet_socks_nr;
     
     
     /* Private packet socket structures. */
    @@ -215,7 +215,7 @@
     
     #define pkt_sk(__sk) ((struct packet_opt *)(__sk)->sk_protinfo)
     
    -void packet_sock_destruct(struct sock *sk)
    +static void packet_sock_destruct(struct sock *sk)
     {
             BUG_TRAP(!atomic_read(&sk->sk_rmem_alloc));
             BUG_TRAP(!atomic_read(&sk->sk_wmem_alloc));
    @@ -234,10 +234,10 @@
     }
     
     
    -extern struct proto_ops packet_ops;
    +static struct proto_ops packet_ops;
     
     #ifdef CONFIG_SOCK_PACKET
    -extern struct proto_ops packet_ops_spkt;
    +static struct proto_ops packet_ops_spkt;
     
     static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
     {
    @@ -1350,8 +1350,8 @@
             }
     }
     
    -int packet_getsockopt(struct socket *sock, int level, int optname,
    - char __user *optval, int __user *optlen)
    +static int packet_getsockopt(struct socket *sock, int level, int optname,
    + char __user *optval, int __user *optlen)
     {
             int len;
             struct sock *sk = sock->sk;
    @@ -1500,7 +1500,8 @@
     #define packet_poll datagram_poll
     #else
     
    -unsigned int packet_poll(struct file * file, struct socket *sock, poll_table *wait)
    +static unsigned int packet_poll(struct file * file, struct socket *sock,
    + poll_table *wait)
     {
             struct sock *sk = sock->sk;
             struct packet_opt *po = pkt_sk(sk);
    @@ -1747,7 +1748,7 @@
     
     
     #ifdef CONFIG_SOCK_PACKET
    -struct proto_ops packet_ops_spkt = {
    +static struct proto_ops packet_ops_spkt = {
             .family = PF_PACKET,
             .owner = THIS_MODULE,
             .release = packet_release,
    @@ -1769,7 +1770,7 @@
     };
     #endif
     
    -struct proto_ops packet_ops = {
    +static struct proto_ops packet_ops = {
             .family = PF_PACKET,
             .owner = THIS_MODULE,
             .release = packet_release,

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Adrian Bunk: "[2.6 patch] net/ipv4/netfilter/: misc possible cleanups"

    Relevant Pages

    • [PATCH] Delete superfluous source file "net/wanrouter/af_wanpipe.c".
      ... 2000 Nenad Corbic o Fixed the corrupt sock lcn problem. ... -/* SECURE SOCKET IMPLEMENTATION ... * routine in the wanpipe driver. ... -static void * dbg_kmalloc(unsigned int size, int prio, int line) { ...
      (Linux-Kernel)
    • [PATCH 1/6] x25: Allow 32 bit socket ioctl in 64 bit kernel
      ... The following patch provides 32 bit userland ioctl support for modular ... socket ioctls in a 64 bit kernel. ... SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ ... SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, ...
      (Linux-Kernel)
    • Re: freeing port - winsock
      ... When I create and destroy many sockets without specifying the local port to bind, It seems that this local port is not free after using the function closesocket. ... It's goal is to create a socket, connect to a remote server on port 80, close the socket and to loop on these actions. ... int host ... SOCKET sock = INVALID_SOCKET; ...
      (comp.programming)
    • [2.6 patch] net/bluetooth/: misc possible cleanups
      ... static inline void cmtp_schedule ... int event); ... +static struct notifier_block hci_sock_nblock = { ... +static int rfcomm_sock_listen(struct socket *sock, ...
      (Linux-Kernel)
    • Re: maximum timeout on socket connection
      ... > operations on the socket. ... * returns zero on success, ETIME on timeout, errno on connect failure. ... int connectex ... socket_set_nonblocking(int sock, bool mode) ...
      (comp.unix.programmer)