Skip to content

Commit 67b95bd

Browse files
subravdavem330
authored andcommitted
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>
1 parent 36e9031 commit 67b95bd

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎net/ipv4/tcp_input.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,7 +2521,7 @@ static void tcp_cwnd_down(struct sock *sk, int flag)
25212521
/* Nothing was retransmitted or returned timestamp is less
25222522
* than timestamp of the first retransmission.
25232523
*/
2524-
static inline int tcp_packet_delayed(const struct tcp_sock *tp)
2524+
static inline bool tcp_packet_delayed(const struct tcp_sock *tp)
25252525
{
25262526
return !tp->retrans_stamp ||
25272527
(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)
25822582
tp->snd_cwnd_stamp = tcp_time_stamp;
25832583
}
25842584

2585-
static inline int tcp_may_undo(const struct tcp_sock *tp)
2585+
static inline bool tcp_may_undo(const struct tcp_sock *tp)
25862586
{
25872587
return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp));
25882588
}
@@ -3371,13 +3371,13 @@ static void tcp_ack_probe(struct sock *sk)
33713371
}
33723372
}
33733373

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)
33753375
{
33763376
return !(flag & FLAG_NOT_DUP) || (flag & FLAG_CA_ALERT) ||
33773377
inet_csk(sk)->icsk_ca_state != TCP_CA_Open;
33783378
}
33793379

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)
33813381
{
33823382
const struct tcp_sock *tp = tcp_sk(sk);
33833383
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)
33873387
/* Check that window update is acceptable.
33883388
* The function assumes that snd_una<=ack<=snd_next.
33893389
*/
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,
33913391
const u32 ack, const u32 ack_seq,
33923392
const u32 nwin)
33933393
{
@@ -4006,7 +4006,7 @@ static int tcp_disordered_ack(const struct sock *sk, const struct sk_buff *skb)
40064006
(s32)(tp->rx_opt.ts_recent - tp->rx_opt.rcv_tsval) <= (inet_csk(sk)->icsk_rto * 1024) / HZ);
40074007
}
40084008

4009-
static inline int tcp_paws_discard(const struct sock *sk,
4009+
static inline bool tcp_paws_discard(const struct sock *sk,
40104010
const struct sk_buff *skb)
40114011
{
40124012
const struct tcp_sock *tp = tcp_sk(sk);
@@ -4028,7 +4028,7 @@ static inline int tcp_paws_discard(const struct sock *sk,
40284028
* (borrowed from freebsd)
40294029
*/
40304030

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)
40324032
{
40334033
return !before(end_seq, tp->rcv_wup) &&
40344034
!after(seq, tp->rcv_nxt + tcp_receive_window(tp));
@@ -5214,7 +5214,7 @@ static __sum16 __tcp_checksum_complete_user(struct sock *sk,
52145214
return result;
52155215
}
52165216

5217-
static inline int tcp_checksum_complete_user(struct sock *sk,
5217+
static inline bool tcp_checksum_complete_user(struct sock *sk,
52185218
struct sk_buff *skb)
52195219
{
52205220
return !skb_csum_unnecessary(skb) &&

0 commit comments

Comments
 (0)