* [2.6 patch] net/dccp/: possible cleanups
@ 2006-06-28 16:54 Adrian Bunk
2006-06-28 18:11 ` Ian McDonald
0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2006-06-28 16:54 UTC (permalink / raw)
To: acme; +Cc: dccp, linux-kernel, netdev
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()
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
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(-)
--- linux-2.6.17-mm2-full/net/dccp/ackvec.c.old 2006-06-27 03:39:45.000000000 +0200
+++ linux-2.6.17-mm2-full/net/dccp/ackvec.c 2006-06-27 03:40:26.000000000 +0200
@@ -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)
--- linux-2.6.17-mm2-full/net/dccp/dccp.h.old 2006-06-27 03:42:17.000000000 +0200
+++ linux-2.6.17-mm2-full/net/dccp/dccp.h 2006-06-27 03:45:06.000000000 +0200
@@ -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);
--- linux-2.6.17-mm2-full/net/dccp/sysctl.c.old 2006-06-27 03:40:57.000000000 +0200
+++ linux-2.6.17-mm2-full/net/dccp/sysctl.c 2006-06-27 03:42:55.000000000 +0200
@@ -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[] = {
{
--- linux-2.6.17-mm2-full/net/dccp/ipv4.c.old 2006-06-27 03:43:27.000000000 +0200
+++ linux-2.6.17-mm2-full/net/dccp/ipv4.c 2006-06-27 03:44:50.000000000 +0200
@@ -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)
{
--- linux-2.6.17-mm2-full/net/dccp/output.c.old 2006-06-27 03:45:13.000000000 +0200
+++ linux-2.6.17-mm2-full/net/dccp/output.c 2006-06-27 03:45:28.000000000 +0200
@@ -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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [2.6 patch] net/dccp/: possible cleanups
2006-06-28 16:54 [2.6 patch] net/dccp/: possible cleanups Adrian Bunk
@ 2006-06-28 18:11 ` Ian McDonald
0 siblings, 0 replies; 2+ messages in thread
From: Ian McDonald @ 2006-06-28 18:11 UTC (permalink / raw)
To: Adrian Bunk; +Cc: acme, dccp, linux-kernel, netdev
Comments below:
On 6/29/06, Adrian Bunk <bunk@stusta.de> wrote:
> 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
Agree
> - 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.
> - make the following needlessly global function static:
> - ipv4.c: dccp_v4_checksum()
Agree
> - #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
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-28 18:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-28 16:54 [2.6 patch] net/dccp/: possible cleanups Adrian Bunk
2006-06-28 18:11 ` Ian McDonald
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).