net/dccp/: possible cleanups
Subsystems (2)
PATCH 1/1 net/dccp/: possible cleanups
This patch contains the following possible cleanups:
- sysctl.c: the Kconfig rules already disallow CONFIG_SYSCTL=n, there's no need for an additional check
- proper extern declarations for some variables in dccp.h
- make the following needlessly global function static:
- ipv4.c: dccp_v4_checksum()
- #if 0 the following unused functions:
- ackvec.c: dccp_ackvector_print()
- ackvec.c: dccp_ackvec_print()
- output.c: dccp_send_delayed_ack()
---
net/dccp/ackvec.c | 4 ++-- net/dccp/dccp.h | 11 +++++++---- net/dccp/ipv4.c | 9 +++++---- net/dccp/output.c | 2 ++ net/dccp/sysctl.c | 11 +---------- 5 files changed, 17 insertions(+), 20 deletions(-)
net/dccp/ackvec.c renamed from net/dccp/ackvec.c.old +2 -2
@@ -320,7 +320,7 @@return -EILSEQ ; } -#ifdef CONFIG_IP_DCCP_DEBUG +#if 0 void dccp_ackvector_print (const u64 ackno,const unsigned char *vector,int len) {if (!dccp_debug)
@@ -346,7 +346,7 @@ av->dccpav_buf + av->dccpav_buf_head, av->dccpav_vec_len); } -#endif +#endif /* 0 */ static void dccp_ackvec_throw_record (struct dccp_ackvec *av,struct dccp_ackvec_record *avr)
net/dccp/dccp.h renamed from net/dccp/dccp.h.old +7 -4
@@ -33,6 +33,13 @@ #define dccp_pr_debug_cat(format, a...)#endif +extern int dccp_feat_default_sequence_window; +extern int dccp_feat_default_rx_ccid; +extern int dccp_feat_default_tx_ccid; +extern int dccp_feat_default_ack_ratio; +extern int dccp_feat_default_send_ack_vector; +extern int dccp_feat_default_send_ndp_count; +extern struct inet_hashinfo dccp_hashinfo;extern atomic_t dccp_orphan_count;
@@ -119,7 +126,6 @@extern int dccp_retransmit_skb (struct sock *sk,struct sk_buff *skb);extern void dccp_send_ack (struct sock *sk); -extern void dccp_send_delayed_ack (struct sock *sk);extern void dccp_send_sync (struct sock *sk,const u64 seq,const enum dccp_pkt_type pkt_type);
@@ -215,9 +221,6 @@extern int dccp_v4_connect (struct sock *sk,struct sockaddr *uaddr,int addr_len); -extern int dccp_v4_checksum (const struct sk_buff *skb, -const __be32 saddr,const __be32 daddr); -extern int dccp_send_reset (struct sock *sk,enum dccp_reset_codes code);extern void dccp_send_close (struct sock *sk,const int active);extern int dccp_invalid_packet (struct sk_buff *skb);
net/dccp/sysctl.c renamed from net/dccp/sysctl.c.old +1 -10
@@ -13,16 +13,7 @@#include <linux/mm.h> #include <linux/sysctl.h> -#ifndef CONFIG_SYSCTL -#error This file should not be compiled without CONFIG_SYSCTL defined -#endif - -extern int dccp_feat_default_sequence_window; -extern int dccp_feat_default_rx_ccid; -extern int dccp_feat_default_tx_ccid; -extern int dccp_feat_default_ack_ratio; -extern int dccp_feat_default_send_ack_vector; -extern int dccp_feat_default_send_ndp_count; +#include "dccp.h" static struct ctl_table dccp_default_table[] = { {
net/dccp/ipv4.c renamed from net/dccp/ipv4.c.old +5 -4
@@ -39,6 +39,9 @@*/ static struct socket *dccp_v4_ctl_socket; +static int dccp_v4_checksum (const struct sk_buff *skb,const __be32 saddr, +const __be32 daddr); +static int dccp_v4_get_port (struct sock *sk,const unsigned short snum) { return inet_csk_get_port(&dccp_hashinfo, sk, snum,
@@ -623,8 +626,8 @@return sk; } -int dccp_v4_checksum (const struct sk_buff *skb,const __be32 saddr, -const __be32 daddr) +static int dccp_v4_checksum (const struct sk_buff *skb,const __be32 saddr, +const __be32 daddr) {const struct dccp_hdr * dh =dccp_hdr (skb);int checksum_len;
@@ -643,8 +646,6 @@ IPPROTO_DCCP, tmp); } -EXPORT_SYMBOL_GPL (dccp_v4_checksum); -static int dccp_v4_verify_checksum (struct sk_buff *skb,const __be32 saddr,const __be32 daddr) {
net/dccp/output.c renamed from net/dccp/output.c.old +2 -0
@@ -484,6 +484,7 @@EXPORT_SYMBOL_GPL (dccp_send_ack); +#if 0 void dccp_send_delayed_ack (struct sock *sk) {struct inet_connection_sock *icsk =inet_csk (sk);
@@ -513,6 +514,7 @@ icsk->icsk_ack.timeout = timeout; sk_reset_timer(sk, &icsk->icsk_delack_timer, timeout); } +#endif /* 0 */ void dccp_send_sync (struct sock *sk,const u64 seq,const enum dccp_pkt_type pkt_type)
Ian McDonald
NAKComments below:
Quoted 3 lines · Adrian Bunk
This patch contains the following possible cleanups:
-sysctl.c: theKconfigrules already disallowCONFIG_SYSCTL=n, there's no need for an additional check
Agree
Quoted 1 line
- proper extern declarations for some variables in
dccp.h
NAK - have sent another patch to shift these to feat.h. Arnaldo is reviewing patches next week.
Quoted 2 lines
- make the following needlessly global function static:
-ipv4.c:dccp_v4_checksum()
Agree
Quoted 4 lines
- #if 0 the following unused functions:
-ackvec.c:dccp_ackvector_print()
-ackvec.c:dccp_ackvec_print()
-output.c:dccp_send_delayed_ack()
NAK on the first two. These are for debugging and DCCP still needs improving so I think worthwhile having there in short term so we can quickly call them if needed.
I will leave Arnaldo or Andrea to comment on last one...
Ian
Signature · 7 lines
Ian McDonald Web: http://wand.net.nz/~iam4 Blog: http://imcdnzl.blogspot.com WAND Network Research Group Department of Computer Science University of Waikato New Zealand