Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'l2tp-trivial-cleanups'

Guillaume Nault says:

====================
l2tp: trivial cleanups

Just a set of unrelated trivial cleanups (remove unused code, make
local functions static, etc.).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+5 -32
+5 -10
net/l2tp/l2tp_core.c
··· 322 322 323 323 if (tunnel->version == L2TP_HDR_VER_3) { 324 324 pn = l2tp_pernet(tunnel->l2tp_net); 325 - g_head = l2tp_session_id_hash_2(l2tp_pernet(tunnel->l2tp_net), 326 - session->session_id); 325 + g_head = l2tp_session_id_hash_2(pn, session->session_id); 327 326 328 327 spin_lock_bh(&pn->l2tp_session_hlist_lock); 329 328 ··· 782 783 783 784 /* Drop skbs from the session's reorder_q 784 785 */ 785 - int l2tp_session_queue_purge(struct l2tp_session *session) 786 + static int l2tp_session_queue_purge(struct l2tp_session *session) 786 787 { 787 788 struct sk_buff *skb = NULL; 788 789 BUG_ON(!session); ··· 793 794 } 794 795 return 0; 795 796 } 796 - EXPORT_SYMBOL_GPL(l2tp_session_queue_purge); 797 797 798 798 /* Internal UDP receive frame. Do the real work of receiving an L2TP data frame 799 799 * here. The skb is not on a list when we get here. ··· 1007 1009 return bufp - optr; 1008 1010 } 1009 1011 1010 - static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, 1011 - struct flowi *fl, size_t data_len) 1012 + static void l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, 1013 + struct flowi *fl, size_t data_len) 1012 1014 { 1013 1015 struct l2tp_tunnel *tunnel = session->tunnel; 1014 1016 unsigned int len = skb->len; ··· 1050 1052 atomic_long_inc(&tunnel->stats.tx_errors); 1051 1053 atomic_long_inc(&session->stats.tx_errors); 1052 1054 } 1053 - 1054 - return 0; 1055 1055 } 1056 1056 1057 1057 /* If caller requires the skb to have a ppp header, the header must be ··· 1189 1193 1190 1194 /* When the tunnel is closed, all the attached sessions need to go too. 1191 1195 */ 1192 - void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel) 1196 + static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel) 1193 1197 { 1194 1198 int hash; 1195 1199 struct hlist_node *walk; ··· 1238 1242 } 1239 1243 write_unlock_bh(&tunnel->hlist_lock); 1240 1244 } 1241 - EXPORT_SYMBOL_GPL(l2tp_tunnel_closeall); 1242 1245 1243 1246 /* Tunnel socket destroy hook for UDP encapsulation */ 1244 1247 static void l2tp_udp_encap_destroy(struct sock *sk)
-12
net/l2tp/l2tp_core.h
··· 180 180 struct net *l2tp_net; /* the net we belong to */ 181 181 182 182 refcount_t ref_count; 183 - #ifdef CONFIG_DEBUG_FS 184 - void (*show)(struct seq_file *m, void *arg); 185 - #endif 186 183 int (*recv_payload_hook)(struct sk_buff *skb); 187 184 void (*old_sk_destruct)(struct sock *); 188 185 struct sock *sock; /* Parent socket */ ··· 187 190 * was created by userspace */ 188 191 189 192 struct work_struct del_work; 190 - 191 - uint8_t priv[0]; /* private data */ 192 193 }; 193 194 194 195 struct l2tp_nl_cmd_ops { ··· 195 200 struct l2tp_session_cfg *cfg); 196 201 int (*session_delete)(struct l2tp_session *session); 197 202 }; 198 - 199 - static inline void *l2tp_tunnel_priv(struct l2tp_tunnel *tunnel) 200 - { 201 - return &tunnel->priv[0]; 202 - } 203 203 204 204 static inline void *l2tp_session_priv(struct l2tp_session *session) 205 205 { ··· 219 229 int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net, 220 230 struct l2tp_tunnel_cfg *cfg); 221 231 222 - void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel); 223 232 void l2tp_tunnel_delete(struct l2tp_tunnel *tunnel); 224 233 struct l2tp_session *l2tp_session_create(int priv_size, 225 234 struct l2tp_tunnel *tunnel, ··· 233 244 void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb, 234 245 unsigned char *ptr, unsigned char *optr, u16 hdrflags, 235 246 int length, int (*payload_hook)(struct sk_buff *skb)); 236 - int l2tp_session_queue_purge(struct l2tp_session *session); 237 247 int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb); 238 248 void l2tp_session_set_header_len(struct l2tp_session *session, int version); 239 249
-3
net/l2tp/l2tp_debugfs.c
··· 177 177 atomic_long_read(&tunnel->stats.rx_packets), 178 178 atomic_long_read(&tunnel->stats.rx_bytes), 179 179 atomic_long_read(&tunnel->stats.rx_errors)); 180 - 181 - if (tunnel->show != NULL) 182 - tunnel->show(m, tunnel); 183 180 } 184 181 185 182 static void l2tp_dfs_seq_session_show(struct seq_file *m, void *v)
-7
net/l2tp/l2tp_ppp.c
··· 424 424 sock_put(ps->__sk); 425 425 } 426 426 427 - /* Called by l2tp_core when a session socket is being closed. 428 - */ 429 - static void pppol2tp_session_close(struct l2tp_session *session) 430 - { 431 - } 432 - 433 427 /* Really kill the session socket. (Called from sock_put() if 434 428 * refcnt == 0.) 435 429 */ ··· 567 573 struct dst_entry *dst; 568 574 569 575 session->recv_skb = pppol2tp_recv; 570 - session->session_close = pppol2tp_session_close; 571 576 #if IS_ENABLED(CONFIG_L2TP_DEBUGFS) 572 577 session->show = pppol2tp_show; 573 578 #endif