diff options
author | Vijay Subramanian <subramanian.vijay@gmail.com> | 2012-07-19 17:32:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-20 13:59:41 -0400 |
commit | 67b95bd78f0de85793bf30835913f6ef784a39b6 (patch) | |
tree | cf9b92f3d430f5f7673109c1acbe59dd5922ed3f /net | |
parent | 36e90319f30e8d1f22cca9f3eb7d593b833ada17 (diff) |
tcp: Return bool instead of int where appropriate
Applied to a set of static inline functions in tcp_input.c
Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_input.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index e67d685a6c0e..21d7f8f3a7a5 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2521,7 +2521,7 @@ static void tcp_cwnd_down(struct sock *sk, int flag) | |||
2521 | /* Nothing was retransmitted or returned timestamp is less | 2521 | /* Nothing was retransmitted or returned timestamp is less |
2522 | * than timestamp of the first retransmission. | 2522 | * than timestamp of the first retransmission. |
2523 | */ | 2523 | */ |
2524 | static inline int tcp_packet_delayed(const struct tcp_sock *tp) | 2524 | static inline bool tcp_packet_delayed(const struct tcp_sock *tp) |
2525 | { | 2525 | { |
2526 | return !tp->retrans_stamp || | 2526 | return !tp->retrans_stamp || |
2527 | (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && | 2527 | (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && |
@@ -2582,7 +2582,7 @@ static void tcp_undo_cwr(struct sock *sk, const bool undo_ssthresh) | |||
2582 | tp->snd_cwnd_stamp = tcp_time_stamp; | 2582 | tp->snd_cwnd_stamp = tcp_time_stamp; |
2583 | } | 2583 | } |
2584 | 2584 | ||
2585 | static inline int tcp_may_undo(const struct tcp_sock *tp) | 2585 | static inline bool tcp_may_undo(const struct tcp_sock *tp) |
2586 | { | 2586 | { |
2587 | return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp)); | 2587 | return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp)); |
2588 | } | 2588 | } |
@@ -3371,13 +3371,13 @@ static void tcp_ack_probe(struct sock *sk) | |||
3371 | } | 3371 | } |
3372 | } | 3372 | } |
3373 | 3373 | ||
3374 | static inline int tcp_ack_is_dubious(const struct sock *sk, const int flag) | 3374 | static inline bool tcp_ack_is_dubious(const struct sock *sk, const int flag) |
3375 | { | 3375 | { |
3376 | return !(flag & FLAG_NOT_DUP) || (flag & FLAG_CA_ALERT) || | 3376 | return !(flag & FLAG_NOT_DUP) || (flag & FLAG_CA_ALERT) || |
3377 | inet_csk(sk)->icsk_ca_state != TCP_CA_Open; | 3377 | inet_csk(sk)->icsk_ca_state != TCP_CA_Open; |
3378 | } | 3378 | } |
3379 | 3379 | ||
3380 | static inline int tcp_may_raise_cwnd(const struct sock *sk, const int flag) | 3380 | static inline bool tcp_may_raise_cwnd(const struct sock *sk, const int flag) |
3381 | { | 3381 | { |
3382 | const struct tcp_sock *tp = tcp_sk(sk); | 3382 | const struct tcp_sock *tp = tcp_sk(sk); |
3383 | return (!(flag & FLAG_ECE) || tp->snd_cwnd < tp->snd_ssthresh) && | 3383 | return (!(flag & FLAG_ECE) || tp->snd_cwnd < tp->snd_ssthresh) && |
@@ -3387,7 +3387,7 @@ static inline int tcp_may_raise_cwnd(const struct sock *sk, const int flag) | |||
3387 | /* Check that window update is acceptable. | 3387 | /* Check that window update is acceptable. |
3388 | * The function assumes that snd_una<=ack<=snd_next. | 3388 | * The function assumes that snd_una<=ack<=snd_next. |
3389 | */ | 3389 | */ |
3390 | static inline int tcp_may_update_window(const struct tcp_sock *tp, | 3390 | static inline bool tcp_may_update_window(const struct tcp_sock *tp, |
3391 | const u32 ack, const u32 ack_seq, | 3391 | const u32 ack, const u32 ack_seq, |
3392 | const u32 nwin) | 3392 | const u32 nwin) |
3393 | { | 3393 | { |
@@ -4006,7 +4006,7 @@ static int tcp_disordered_ack(const struct sock *sk, const struct sk_buff *skb) | |||
4006 | (s32)(tp->rx_opt.ts_recent - tp->rx_opt.rcv_tsval) <= (inet_csk(sk)->icsk_rto * 1024) / HZ); | 4006 | (s32)(tp->rx_opt.ts_recent - tp->rx_opt.rcv_tsval) <= (inet_csk(sk)->icsk_rto * 1024) / HZ); |
4007 | } | 4007 | } |
4008 | 4008 | ||
4009 | static inline int tcp_paws_discard(const struct sock *sk, | 4009 | static inline bool tcp_paws_discard(const struct sock *sk, |
4010 | const struct sk_buff *skb) | 4010 | const struct sk_buff *skb) |
4011 | { | 4011 | { |
4012 | const struct tcp_sock *tp = tcp_sk(sk); | 4012 | const struct tcp_sock *tp = tcp_sk(sk); |
@@ -4028,7 +4028,7 @@ static inline int tcp_paws_discard(const struct sock *sk, | |||
4028 | * (borrowed from freebsd) | 4028 | * (borrowed from freebsd) |
4029 | */ | 4029 | */ |
4030 | 4030 | ||
4031 | static inline int tcp_sequence(const struct tcp_sock *tp, u32 seq, u32 end_seq) | 4031 | static inline bool tcp_sequence(const struct tcp_sock *tp, u32 seq, u32 end_seq) |
4032 | { | 4032 | { |
4033 | return !before(end_seq, tp->rcv_wup) && | 4033 | return !before(end_seq, tp->rcv_wup) && |
4034 | !after(seq, tp->rcv_nxt + tcp_receive_window(tp)); | 4034 | !after(seq, tp->rcv_nxt + tcp_receive_window(tp)); |
@@ -5214,7 +5214,7 @@ static __sum16 __tcp_checksum_complete_user(struct sock *sk, | |||
5214 | return result; | 5214 | return result; |
5215 | } | 5215 | } |
5216 | 5216 | ||
5217 | static inline int tcp_checksum_complete_user(struct sock *sk, | 5217 | static inline bool tcp_checksum_complete_user(struct sock *sk, |
5218 | struct sk_buff *skb) | 5218 | struct sk_buff *skb) |
5219 | { | 5219 | { |
5220 | return !skb_csum_unnecessary(skb) && | 5220 | return !skb_csum_unnecessary(skb) && |