From af610b4ca19f513a50d47ea93ed57241383c8081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Fri, 15 Jun 2007 12:58:38 +0300 Subject: [TCP]: Add tcp_dec_pcount_approx int variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ilpo Järvinen Signed-off-by: David S. Miller --- include/net/tcp.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/net/tcp.h b/include/net/tcp.h index dde04afbe0a..9d3438f6b52 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -599,16 +599,21 @@ static inline int tcp_skb_mss(const struct sk_buff *skb) return skb_shinfo(skb)->gso_size; } -static inline void tcp_dec_pcount_approx(__u32 *count, - const struct sk_buff *skb) +static inline void tcp_dec_pcount_approx_int(__u32 *count, const int decr) { if (*count) { - *count -= tcp_skb_pcount(skb); + *count -= decr; if ((int)*count < 0) *count = 0; } } +static inline void tcp_dec_pcount_approx(__u32 *count, + const struct sk_buff *skb) +{ + tcp_dec_pcount_approx_int(count, tcp_skb_pcount(skb)); +} + static inline void tcp_packets_out_inc(struct sock *sk, const struct sk_buff *skb) { -- cgit v1.2.3