diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2007-04-21 01:18:02 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:29:34 -0400 |
commit | 9e412ba7632f71259a53085665d4983b78257b7c (patch) | |
tree | b02d6df7e5357a741bf6d52a93e04a52b84f1f90 /include/net | |
parent | 38b4da383705394788aa09208917ba200792de4b (diff) |
[TCP]: Sed magic converts func(sk, tp, ...) -> func(sk, ...)
This is (mostly) automated change using magic:
sed -e '/struct sock \*sk/ N' -e '/struct sock \*sk/ N'
-e '/struct sock \*sk/ N' -e '/struct sock \*sk/ N'
-e 's|struct sock \*sk,[\n\t ]*struct tcp_sock \*tp\([^{]*\n{\n\)|
struct sock \*sk\1\tstruct tcp_sock *tp = tcp_sk(sk);\n|g'
-e 's|struct sock \*sk, struct tcp_sock \*tp|
struct sock \*sk|g' -e 's|sk, tp\([^-]\)|sk\1|g'
Fixed four unused variable (tp) warnings that were introduced.
In addition, manually added newlines after local variables and
tweaked function arguments positioning.
$ gcc --version
gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
...
$ codiff -fV built-in.o.old built-in.o.new
net/ipv4/route.c:
rt_cache_flush | +14
1 function changed, 14 bytes added
net/ipv4/tcp.c:
tcp_setsockopt | -5
tcp_sendpage | -25
tcp_sendmsg | -16
3 functions changed, 46 bytes removed
net/ipv4/tcp_input.c:
tcp_try_undo_recovery | +3
tcp_try_undo_dsack | +2
tcp_mark_head_lost | -12
tcp_ack | -15
tcp_event_data_recv | -32
tcp_rcv_state_process | -10
tcp_rcv_established | +1
7 functions changed, 6 bytes added, 69 bytes removed, diff: -63
net/ipv4/tcp_output.c:
update_send_head | -9
tcp_transmit_skb | +19
tcp_cwnd_validate | +1
tcp_write_wakeup | -17
__tcp_push_pending_frames | -25
tcp_push_one | -8
tcp_send_fin | -4
7 functions changed, 20 bytes added, 63 bytes removed, diff: -43
built-in.o.new:
18 functions changed, 40 bytes added, 178 bytes removed, diff: -138
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/tcp.h | 25 | ||||
-rw-r--r-- | include/net/tcp_ecn.h | 11 |
2 files changed, 22 insertions, 14 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index e79803353c83..43910fe3c448 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -420,9 +420,9 @@ extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, | |||
420 | 420 | ||
421 | /* tcp_output.c */ | 421 | /* tcp_output.c */ |
422 | 422 | ||
423 | extern void __tcp_push_pending_frames(struct sock *sk, struct tcp_sock *tp, | 423 | extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, |
424 | unsigned int cur_mss, int nonagle); | 424 | int nonagle); |
425 | extern int tcp_may_send_now(struct sock *sk, struct tcp_sock *tp); | 425 | extern int tcp_may_send_now(struct sock *sk); |
426 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); | 426 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); |
427 | extern void tcp_xmit_retransmit_queue(struct sock *); | 427 | extern void tcp_xmit_retransmit_queue(struct sock *); |
428 | extern void tcp_simple_retransmit(struct sock *); | 428 | extern void tcp_simple_retransmit(struct sock *); |
@@ -479,8 +479,10 @@ static inline void tcp_fast_path_on(struct tcp_sock *tp) | |||
479 | __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); | 479 | __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); |
480 | } | 480 | } |
481 | 481 | ||
482 | static inline void tcp_fast_path_check(struct sock *sk, struct tcp_sock *tp) | 482 | static inline void tcp_fast_path_check(struct sock *sk) |
483 | { | 483 | { |
484 | struct tcp_sock *tp = tcp_sk(sk); | ||
485 | |||
484 | if (skb_queue_empty(&tp->out_of_order_queue) && | 486 | if (skb_queue_empty(&tp->out_of_order_queue) && |
485 | tp->rcv_wnd && | 487 | tp->rcv_wnd && |
486 | atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf && | 488 | atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf && |
@@ -591,10 +593,10 @@ static inline void tcp_dec_pcount_approx(__u32 *count, | |||
591 | } | 593 | } |
592 | } | 594 | } |
593 | 595 | ||
594 | static inline void tcp_packets_out_inc(struct sock *sk, | 596 | static inline void tcp_packets_out_inc(struct sock *sk, |
595 | struct tcp_sock *tp, | ||
596 | const struct sk_buff *skb) | 597 | const struct sk_buff *skb) |
597 | { | 598 | { |
599 | struct tcp_sock *tp = tcp_sk(sk); | ||
598 | int orig = tp->packets_out; | 600 | int orig = tp->packets_out; |
599 | 601 | ||
600 | tp->packets_out += tcp_skb_pcount(skb); | 602 | tp->packets_out += tcp_skb_pcount(skb); |
@@ -778,18 +780,21 @@ static inline void tcp_minshall_update(struct tcp_sock *tp, int mss, | |||
778 | tp->snd_sml = TCP_SKB_CB(skb)->end_seq; | 780 | tp->snd_sml = TCP_SKB_CB(skb)->end_seq; |
779 | } | 781 | } |
780 | 782 | ||
781 | static inline void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp) | 783 | static inline void tcp_check_probe_timer(struct sock *sk) |
782 | { | 784 | { |
785 | struct tcp_sock *tp = tcp_sk(sk); | ||
783 | const struct inet_connection_sock *icsk = inet_csk(sk); | 786 | const struct inet_connection_sock *icsk = inet_csk(sk); |
787 | |||
784 | if (!tp->packets_out && !icsk->icsk_pending) | 788 | if (!tp->packets_out && !icsk->icsk_pending) |
785 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_PROBE0, | 789 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_PROBE0, |
786 | icsk->icsk_rto, TCP_RTO_MAX); | 790 | icsk->icsk_rto, TCP_RTO_MAX); |
787 | } | 791 | } |
788 | 792 | ||
789 | static inline void tcp_push_pending_frames(struct sock *sk, | 793 | static inline void tcp_push_pending_frames(struct sock *sk) |
790 | struct tcp_sock *tp) | ||
791 | { | 794 | { |
792 | __tcp_push_pending_frames(sk, tp, tcp_current_mss(sk, 1), tp->nonagle); | 795 | struct tcp_sock *tp = tcp_sk(sk); |
796 | |||
797 | __tcp_push_pending_frames(sk, tcp_current_mss(sk, 1), tp->nonagle); | ||
793 | } | 798 | } |
794 | 799 | ||
795 | static inline void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq) | 800 | static inline void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq) |
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index b5f7c6ac0880..89eb3e05116d 100644 --- a/include/net/tcp_ecn.h +++ b/include/net/tcp_ecn.h | |||
@@ -27,9 +27,10 @@ static inline void TCP_ECN_send_synack(struct tcp_sock *tp, | |||
27 | TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_ECE; | 27 | TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_ECE; |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp, | 30 | static inline void TCP_ECN_send_syn(struct sock *sk, struct sk_buff *skb) |
31 | struct sk_buff *skb) | ||
32 | { | 31 | { |
32 | struct tcp_sock *tp = tcp_sk(sk); | ||
33 | |||
33 | tp->ecn_flags = 0; | 34 | tp->ecn_flags = 0; |
34 | if (sysctl_tcp_ecn) { | 35 | if (sysctl_tcp_ecn) { |
35 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR; | 36 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR; |
@@ -44,9 +45,11 @@ TCP_ECN_make_synack(struct request_sock *req, struct tcphdr *th) | |||
44 | th->ece = 1; | 45 | th->ece = 1; |
45 | } | 46 | } |
46 | 47 | ||
47 | static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp, | 48 | static inline void TCP_ECN_send(struct sock *sk, struct sk_buff *skb, |
48 | struct sk_buff *skb, int tcp_header_len) | 49 | int tcp_header_len) |
49 | { | 50 | { |
51 | struct tcp_sock *tp = tcp_sk(sk); | ||
52 | |||
50 | if (tp->ecn_flags & TCP_ECN_OK) { | 53 | if (tp->ecn_flags & TCP_ECN_OK) { |
51 | /* Not-retransmitted data segment: set ECT and inject CWR. */ | 54 | /* Not-retransmitted data segment: set ECT and inject CWR. */ |
52 | if (skb->len != tcp_header_len && | 55 | if (skb->len != tcp_header_len && |