diff options
author | Eric Dumazet <edumazet@google.com> | 2012-05-16 19:15:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-17 14:59:59 -0400 |
commit | a2a385d627e1549da4b43a8b3dfe370589766e1c (patch) | |
tree | d61e9913497c6c14406032f6a0822738707f1abf /net/ipv4/tcp_minisocks.c | |
parent | e005d193d55ee5f757b13306112d8c23aac27a88 (diff) |
tcp: bool conversions
bool conversions where possible.
__inline__ -> inline
space cleanups
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_minisocks.c')
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 6f6a91832826..b85d9fe7d663 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -55,7 +55,7 @@ EXPORT_SYMBOL_GPL(tcp_death_row); | |||
55 | * state. | 55 | * state. |
56 | */ | 56 | */ |
57 | 57 | ||
58 | static int tcp_remember_stamp(struct sock *sk) | 58 | static bool tcp_remember_stamp(struct sock *sk) |
59 | { | 59 | { |
60 | const struct inet_connection_sock *icsk = inet_csk(sk); | 60 | const struct inet_connection_sock *icsk = inet_csk(sk); |
61 | struct tcp_sock *tp = tcp_sk(sk); | 61 | struct tcp_sock *tp = tcp_sk(sk); |
@@ -72,13 +72,13 @@ static int tcp_remember_stamp(struct sock *sk) | |||
72 | } | 72 | } |
73 | if (release_it) | 73 | if (release_it) |
74 | inet_putpeer(peer); | 74 | inet_putpeer(peer); |
75 | return 1; | 75 | return true; |
76 | } | 76 | } |
77 | 77 | ||
78 | return 0; | 78 | return false; |
79 | } | 79 | } |
80 | 80 | ||
81 | static int tcp_tw_remember_stamp(struct inet_timewait_sock *tw) | 81 | static bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw) |
82 | { | 82 | { |
83 | struct sock *sk = (struct sock *) tw; | 83 | struct sock *sk = (struct sock *) tw; |
84 | struct inet_peer *peer; | 84 | struct inet_peer *peer; |
@@ -94,17 +94,17 @@ static int tcp_tw_remember_stamp(struct inet_timewait_sock *tw) | |||
94 | peer->tcp_ts = tcptw->tw_ts_recent; | 94 | peer->tcp_ts = tcptw->tw_ts_recent; |
95 | } | 95 | } |
96 | inet_putpeer(peer); | 96 | inet_putpeer(peer); |
97 | return 1; | 97 | return true; |
98 | } | 98 | } |
99 | return 0; | 99 | return false; |
100 | } | 100 | } |
101 | 101 | ||
102 | static __inline__ int tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win) | 102 | static bool tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win) |
103 | { | 103 | { |
104 | if (seq == s_win) | 104 | if (seq == s_win) |
105 | return 1; | 105 | return true; |
106 | if (after(end_seq, s_win) && before(seq, e_win)) | 106 | if (after(end_seq, s_win) && before(seq, e_win)) |
107 | return 1; | 107 | return true; |
108 | return seq == e_win && seq == end_seq; | 108 | return seq == e_win && seq == end_seq; |
109 | } | 109 | } |
110 | 110 | ||
@@ -143,7 +143,7 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, | |||
143 | struct tcp_options_received tmp_opt; | 143 | struct tcp_options_received tmp_opt; |
144 | const u8 *hash_location; | 144 | const u8 *hash_location; |
145 | struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); | 145 | struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); |
146 | int paws_reject = 0; | 146 | bool paws_reject = false; |
147 | 147 | ||
148 | tmp_opt.saw_tstamp = 0; | 148 | tmp_opt.saw_tstamp = 0; |
149 | if (th->doff > (sizeof(*th) >> 2) && tcptw->tw_ts_recent_stamp) { | 149 | if (th->doff > (sizeof(*th) >> 2) && tcptw->tw_ts_recent_stamp) { |
@@ -316,7 +316,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) | |||
316 | struct inet_timewait_sock *tw = NULL; | 316 | struct inet_timewait_sock *tw = NULL; |
317 | const struct inet_connection_sock *icsk = inet_csk(sk); | 317 | const struct inet_connection_sock *icsk = inet_csk(sk); |
318 | const struct tcp_sock *tp = tcp_sk(sk); | 318 | const struct tcp_sock *tp = tcp_sk(sk); |
319 | int recycle_ok = 0; | 319 | bool recycle_ok = false; |
320 | 320 | ||
321 | if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp) | 321 | if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp) |
322 | recycle_ok = tcp_remember_stamp(sk); | 322 | recycle_ok = tcp_remember_stamp(sk); |
@@ -575,7 +575,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, | |||
575 | struct sock *child; | 575 | struct sock *child; |
576 | const struct tcphdr *th = tcp_hdr(skb); | 576 | const struct tcphdr *th = tcp_hdr(skb); |
577 | __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); | 577 | __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); |
578 | int paws_reject = 0; | 578 | bool paws_reject = false; |
579 | 579 | ||
580 | tmp_opt.saw_tstamp = 0; | 580 | tmp_opt.saw_tstamp = 0; |
581 | if (th->doff > (sizeof(struct tcphdr)>>2)) { | 581 | if (th->doff > (sizeof(struct tcphdr)>>2)) { |